It’s been eight years since I was last this excited about programming. The last time it was when I had finally gotten a handle on C programming in my college days, and was happily burning hours making text-based games using rudimentary colors and random number generators.
Today I feel the same joy. And the reason is Erlang. Or to be more specific, functional programming.
Joy is something that a programmer forgets about as soon as inheritance is introduced. Because then begins a lifelong struggle to bend the idiosyncrasies of object-oriented programming to produce meaningful software. It takes a few months of rabid effort to at least start thinking in objects, only to realize that the hierarchy you so carefully orchestrated is now nothing but a hindrance. Add to that work pressures and the desire to buy that fancy car, and you can pretty much imagine what happens to joy.
I had slipped into the same world, but Erlang has been my savior.
Finally, it’s beginning to look like programs can be highly compact and elegant at the same time. Finally, recursion doesn’t look scary, and even someone dull like me can feel motivated to compose wicked solutions to hard problems!
It’s almost midnight, and I can think of nothing better than fiddling with Erlang and trying to compose elegant solutions by stringing together functions! Everything is so elegant and so well tied together that I feel I’ll die of happiness! It almost feels like I’m doing pure-math theorems rather than writing programs.
Oh, sorry. You thought I was going to explain how functional programming is more brain-friendly and more fun and more powerful and more safe and all that? Sorry, but I can’t even if I wanted to. This is like possessing a super-power, and can only be experienced by diving in yourself.
So, don’t be afraid. Learn a little, code a little. And before long, the gods of functional programming will smile on you!