Alois Kraus


  Home  |   Contact  |   Syndication    |   Login
  133 Posts | 8 Stories | 368 Comments | 162 Trackbacks



Post Categories


July 2010 Entries

Patrick Smacchia has shared his thoughts why 100% test coverage is a desirable thing to have. You can test 80% of your code quite easy but the edge cases are the hard ones which take 80% of the time to write good tests for them. Patrick claims that it is worth the effort since in the last 20% you will find most of your bugs. Why is it so hard to get to full coverage? To make the corner cases testable you need some extra ugly constructs in your product (normally via ifdefs where you throw an exception). ......

F# is a powerful language. When you start with functional programming you find it hard to write truly functional code. After all you have thought in imperative terms like for, foreach, while, do while, …. Mark Pearl has provided a little sample how to parse a text file with F# to count the error and warnings inside it. I think it can be more functional. Here is my try: #light open System open System.IO let lineSequence(file) = let reader = File.OpenText(file) Seq.unfold(fun line -> if line = null ......

Did you ever want a feature but the system got in your way? In my case I wanted to to get the last thrown exception outside of any catch block. Be warned that this is a deep dive into the guts of the Common Language Runtime. Language architects and Api designers should stop reading from here on. Yes I did break the rules of encapsulation and many other things. I am perfectly fine with a reputation to use Apis in not intended ways but otherwise it would have been impossible create a tracing library ......