Posts

Showing posts from June, 2012

When in doubt, Maybe can help you

I am slowly but firmly falling in love with the functional approach to programming. I know, it is not a silver bullet and it cant solve all of your problems, but there are aspects of functional style programming that I am beginning to appreciate more and more. Take for example Monads. There is a whole lot of talk about monads, monoids and whatnot floating around the intertubes, and through all that almost hard core mathematical chatter that is sometimes quite hard to see what one can benefit from using such a convoluted concept. Specially you get this question a lot when talking to Java programmers. Functional style programming can feel quite awkward in Java, with all the character noise inner classes bring with them, but sometimes it is not all that bad. Some of the functional style concept I've been exploring lately is what Haskell calls the Maybe monad . (Scala has it in it's Option class) Essentially, the Maybe class is all about entirely elliminating null refer