QCon 2009: No more Lego analogies, please!

While presenting the Pragmatic Real-World Scala talk at QCon London 2009, Jonas Bonér introduced functional programming as something that ultimately leads to more usable code and compared it to Lego, in a sense that you can take functions, combine them easily to get new functions etc. Sounds familiar? OO anyone? Stop the Lego analogies, please.

I remember exactly the same marketing messages for object oriented software, where lego-like boxes will be magically combined with other lego-like boxes to produce other boxes and everything will be nice and green and pink bunnies will jump all around us..

I appreciate that functional programming is a different paradigm where statelessness can help a lot with parallel processing, and the revival of the interest in that is probably the only useful thing that came out of computer science academic projects in the last decade, but are the real benefits of it usable code and lego-like combinatorial promise that often ends up as a mess? Please tell me that there is more to functional programming than that.

Bonér sort of lost me at a point where he said that unlike objects, functions can be mathematically proven that they are correct. Some of the most respected scientific minds in the computer science history disagree with this. Donald Knuth’s famous quote on this is “Beware of bugs in the above code. I have only proven it correct, not tested it.” C.A.R. Hoare said this morning that “You cannot ask a scientist to check whether a program does not contain undesirable features.”. How can you mathematically prove that something doesn’t have bugs? I’d really like this promise to deliver but it seems completely unrealistic.

Too bad – the start of the presentation introducing Scala was really interesting and I looked forward to learning something new.

I will be covering QCon 09 in detail on this blog. Click here for other news and reviews from the conference.