Tuesday, 1 July 2014

A short review of some Erlang books

Erlang is one of those languages that I always meant to dive in to, but never did. At the peak of the last hype wave, I bought the books but they got put aside because ... well, life got in the way. I decided to give it a go, by the book(s). Usually I just skim books and get cracking but I thought it'd be a good idea to do it properly this time.

Erlang Programming - O'Reilly

If you're at all familiar with concurrent programming, either from a CS course in Haskell or having spanked the JVM with Scala ... skip this book. It does a really good job of drawing out material over many pages, but fails to hit key points or make good relationships to things people already know.

In the books defense, if you are new to programming or need a bit more talking through some things then it might be OK but even then I feel some things might be confusing.

Erlang and OTP in Action - Manning

This books is much better than "Erlang Programming". Not only does it keep things clear, but it doesn't baby you when it isn't required. This book covers A LOT in a quick space of time.

The emphasis on good idiomatics was a positive thing, as was the parts that basically said "I know you're thinking X but we won't cover that because it's best not to use it". Diving straight in to OTP with a relatable project was great as was the depth of coverage of the OTP "way" in general. Though I understood the code, implemented their projects and didn't have questions about the material ... I was left scratching my head when working out how to use this knowledge easily when my requirements stepped outside the examples.

Programming Erlang - Pragmatic Programmers

I have saved the best until last. This book is written by Joe Armstrong, one of the creators of Erlang. As you'd expect it covers a great deal. What sets this book apart from the others is the way everything is presented. Joe does a really good job at relating core concepts to OOP concepts we migh be more familar with.

Even better, there's tons of material that reflects Erlang's growing user base in the web backend. There's examples on embedding a webserver, using websockets, parsing JSON and other goodness. Another good thing covered early is how to properly include other Erlang code using Rebar.

Summary

In short, if you have been programming a while, especially if you're from a C background or have done lots of sorting/searching/tree-walking code then just get the Pragmatic "Programming Erlang" book. That said, I did enjoy the examples (a web cache) in Erlang and OTP in action and I don't regret buying that one either. If you already have a strong functional programming background, or are specifically looking to start a project as part of a web stack, then you can't go wrong with "Programming Erlang" to get started

My review is slightly biased as I normally take a "learn by exhaustive hacking" approach to new languages. It's often the wrong approach but it does mean my expectations might not be ideal when cracking open a "Program X" type book.