Saturday, August 4, 2012

I've been experimenting with scala, clojure and haskell in the past several weeks, along the side reading lots of articles, blogs comparing these popular languages.

 To start with, I am not a big fan of OO -- I was a hardcore C++ developer since 2002 -- I read GoF book at least 3 times and actually applied them in large scale software built for trading platforms. Around 2005 when I first encounters functional programming languages, I started to realize how much boiler-plate people have to put in to work with OO. OO is one of those ideas that sound very great but offers no much practical use. It's just for lazy people to structure their code in an obvious way, instead of elegant way.

That said, scala, although has rich features from both OO and FP world, can't get away with boiler-plate code -- you have to at least declare singleton class, or object before you can even start a function definition. Also, the fact that everything is an object makes the syntax awkward some times.

 Clojure is beautiful in that it's a lisp -- almost pure functional. I have nothing to complain about the syntax because I am a big fan of lisp and emacs. However, once I have to integrate with existing java libraries, the OO junk kicks in again.

 I guess these are great languages however built on a less optimal platform. Java implemented OO in a very poor way that makes it so verbose and full of boilerplate code -- if you choose any languages built on top of JVM in the hope of leveraging existing Java code, you will have to deal with the Java junk some day.

Haskell is beautiful, however libraries are less available and installation is a pain compared to JVM based languages.