Er… lang?

After many years of saying “I think I should learn functional programming” I am finally taking the plunge with Erlang. I feel like a guy who finally buys that cool leather jacket only to discover it really doesn’t suit him. But it was expensive so it will stay in the wardrobe forever in the hope that “one day…”

That’s not to say I’m not enjoying Erlang (I am), or that I am going to give up on this adventure (I’m not). It’s just that I’m not certain functional programming suits me like I thought it would.

I agree with everything I thought it stood for, but I’m surprised by some of my findings – which might be more Erlang-y rather than functional-y.

Erlang doesn’t have strings as such – a string literal is short-form for a list of numbers. It therefore feels perverse when it conversely tries to display lists of numbers as letters.

It also doesn’t have looping constructs. That makes sense because loops usually have a changing variable in their loop condition. And Erlang variables aren’t… variable.

But it does mean I’ve really had to learn something that I thought I knew, but it turned out I’ve never needed, and therefore I’ve not previously discovered that I didn’t properly know it after all. And that is Tail Recursion.

Despite this, some of the things I’ve learned have very much pleased me. The most pleasing is that, back in the 80s, Erlang was implemented in Prolog. Prolog is another language I want to learn.

Maybe that hints that I am on the right track after all. Or perhaps Prolog is like those leather trousers, which definitely won’t suit me!

“If you know it but you’ve never used it, then you don’t know it.”

Me

Leave a Reply

Your email address will not be published. Required fields are marked *