ProgrammingErlang
Author: Joe Armstrong
Review created: 2015-09-16
I've had the Programming Erlang in my bookshelf for quite some time but never gotten around to read it. I had the intention to learn a bit of Erlang when I bought it, but something came up, probably a course, and I forgot about the book and I forgot about learning Erlang. When I came to the chapter on Erlang in Seven Languages in the book Seven Weeks that I read now, I found the the explanations to be a bit brief, I suddenly remembered Programming Erlang and started to read it. These are my impressions.
Programming Erlang is an introductory book to Erlang. The author expects the reader to be a programmer, but no specific knowledge of Erlang or some other functional programming language is required.
The book starts out with a description of how to compile and run Erlang programs both from the Erlang shell and directly from the command prompt. It is usually a good thing to explain how to run programs in the language a book is about before jumping into the actual description of the language, so I think this is a good start :)
In the following chapters regular, non-concurrent programming in Erlang is described. All the built in datastructures (lists, tuples and so on) and the most commonly used keywords are described. Having read these chapters, the reader should be able to write fairly advanced sequential programs in Erlang.
The next part of the book contains the topic that is its main focus of: concurrent programming. It is described, in quite a detail, how to write message based concurrent programs in Erlang. It it clear that the author is very passionate about this topic. He includes anecdotes from using Erlang at Ericsson to write really fault-tolerant programs. Such anecdotes I often find really interesting. This time is no exception.
One section of the book that I find particularly interesting is the one where Armstrong describes how to write a (concurrent, of course) server which can be upgraded on the fly in runtime. This is rather amazing. I suppose such stuff can be performed in other languages, e.g. Java, as well, but most certainly not as easy. This really is a killer feature of Erlang.
Some of the latter chapters in the books is dedicated to network programming and the OPT. OTP stand for Open Teleophony Platform and is, as its name suggests, a vast library of Erlang modules that can be downloaded and used for free. The book includes a number of examples of how one best could utilize code from the OTP.
In the end of the book there is a number of appendices covering, unit testing, debugging and such stuff. Also, a listing of most of the modules in kernel
and stdlib
libraries
I think this book provides a really good introduction to Erlang. It is easy and fun to read and most of the examples are clear and concise. The author uses the same patterns in most example programs in the book, which is good I think, because it makes it easier to understand them. Another thing I like is that the author describes how he writes Erlang programs and what code patterns he uses. "This is a template that I almost always use when writing client-server based programs". Coming from the creator of Erlang, such sentences carry some weight...
A second edition of the book has come out since I bought my copy of the book. I don't know what the differences are between the two editions, but if I'll ever use Erlang professionally, I will order the most recent edition of the book immediately. Recommended!
Rating: 4 out of 5.