I’m reading “The Art of Functional Programming” by Ming Quan Tran. The book is short (200+ pages) and well-written, offering a rationale for all functional programming constructs and techniques, often comparing FP solutions with imperative / OO approaches.Continue reading “My First OCaml Code”
It all starts in schools. When they teach you how to program a computer. You get plenty of code that just works in the happy path scenario. So happy path that there are no other paths at all.
And then it is easy to grow, line of code after line of code, with the idea that error handling is not really part of the code. Elegant code has nothing to do with errors. Could be a sort of brainwashing.
And then language designers, present you the ultimate error-handling solution – lo and behold the Exceptions!
You can still write the code the way you were taught and then when something bad happens, throw an exception. A flare fired in the sky, in the hope that some alert patrol on guard could spot and come to the rescue.Continue reading “Surprisingly Exceptional”