25 June 2007

Scala to heaven, under the surface

Selecting one "Programming language of the year", yes but which one?

At school

First, let's have a look at my abysmal lack of culture on the subject. I think my first programming language must have been Basic. The only mental image I keep from that time is a linear sequence of instructions, with the ability to go back in time or to jump in the "future" to do something else.

Then I played with the Turtle a bit (Logo), I was much more comfortable with recursion, the way function reuse was presented to me and the interactivity with the environment.

At the Engineering school

But they told me that I should structure my programs, encapsulate, and there came Pascal and (later) ADA. In the meantime, I was shown enough Scheme to understand that recursion must be a fundamental thing, at least to return change in a vending machine.

My first internship

C++ and object-orientation sparked a bit more my interest in programming languages, as I first worked on a library for algorithmic geometry. Now I have "objects" I can manipulate, turn up and down, shuffle around. My language eventually supported a wonderful abstraction. "Hello, Mr Object, I am also an object, how can I help you?".

Most of my professional life

Java was a natural move from C++. No more nasty memory bugs, pointers and de-reference. Yes, that kind of profound analysis,... But to my credit, I was more interested by finding efficient ways to understand business concepts and map them properly to a programming language than by the language itself.

The last 2 years

On the road to languages zen, I had several "enlightments". First, the Pragmatic Programmers book gave me an advice: learn a new language each year. Well yes, nice advice, but I have JAVA, the quintessential power of a modern object-language at the tip of my fingers. Why in hell would I be interested in something else?

But damn, it was a conspiracy. Paul Graham, chanting the virtues of Lisp, Steve Yegge executing the nouns (what! my favourite thinking tool?!), even my favourite platform was growing new groovy languages.

Cool! Good place to start. I happened to imagine that, for the product we developed at the time, programing was required here and there to help users describe exactly what they wanted. So I embedded Groovy in our application and started appreciate some nice features:

myList.join(", ") or myList.each { x -> doStuffWith(x) }

Wow, this makes a difference. I can express my mind much more precisely than before! Projecting my ideas on a editor is much more straightforward.

Yes, but can we do better?

Let's go: "Programming with Ruby". Seems cool, Ruby has inspired Groovy (blocks, some of it early syntax), it's recommended by the gurus and there's even this thing, making a lot of noise, there, Rails. Not a bad idea, java for webapps is such a stack.

Of course, I appreciated that I was able to build my first useless website with just a few lines of code and an editor (not to mention my further use of Camping). But I was really blown away by Ruby. So many features that can really make your life easier and say more with less.

One month ago

Time to move on, now I know I don't know. Even if I appreciate that Ruby can "steal" features from other languages, I want something new and useful this year.

Let's go hunting for the language of the year!