Skip to content. | Skip to navigation

Sections
Personal tools
You are here: Home / Users / Michael T. Richter / YFL-related Blog / Review: Learn You Some Erlang for Great Good!

Review: Learn You Some Erlang for Great Good!

This book, although labelled "A Beginner's Guide", belongs on the bookshelf of anybody who is a serious user of Erlang (with the possible exception of those who made the language or who have used it for decades).

In the interests of full disclosure, I should point out that I number the author of Learn You Some Erlang for Great Good! (henceforth LYSE) among my net.friends, that I have acted as a reviewer of this work since fairly near its inception and that I have a "thank you" credit as a result.  I also received the PDF version of this book for free and will, supposedly, should the mailing system ever work itself out, also own a gratis dead tree edition courtesy of the publisher.  The gratis edition was granted no-strings-attached, but with the tacit understanding that a review should be in the offing.  Please keep these possible biases in mind while reading the review.

 

It seems like only yesterday that I stumbled over Fred Hébert, the humble, young PHP web programmer who was trying to get to grips with Erlang in the #erlang channel on IRC.  It would have been easy to look down on him a bit, given that Erlang was almost a natural fit to my own past experience (QNX for message-passing concurrency and Haskell for functional programming), but two things stayed my hand: first, I'm much more mature now than I was at Fred's age; second, I had a feeling that Fred had hidden depths.  I'm glad of these instincts because Fred proved himself a very capable programmer, a very capable learner and, to my surprise, a very capable teacher.  It took him no time at all, really, to surpass my knowledge of Erlang because these days I'm a programming dilettante, not a professional practitioner.

 

Early in the LYSE project, Fred, not a native English speaker, solicited aid from any and all who'd give it for his "cute little project" (as it was initially labelled in my mind) of documenting Erlang for beginners.  Since I am an English teacher these days, with almost as many years experience in this as I had in software before it, I kind of gravitated toward helping Fred with the project, reading over his manuscripts for English usage as well as for pedagogical value.  I was thus privileged to witness the rare blossoming of someone's technical skills, language skills and instructional skills all at the same time.

 

And now I have the rare privilege of reviewing the product of these skills.

The Good

Erlang is one of my favourite programming languages.  This book is one of the best books available on the language.  It's a given that I will have a lot of good things to say about it.

The Writing

Fred's style is breezy without being flaky or muddle-headed.  His examples are often comical, sometimes thought-provoking and yet always salient and to the point.  His jokes keep the tone light and allow him to sneak difficult concepts that your brain would traditionally reject as "too hard" past your defenses so that you often learn in spite of what you think you can do.  This is exactly the kind of writing that beginners need when facing a language that's as "weird" as Erlang.

 

Another attractive element of the writing is that Fred writes in an "exploratory" manner.  One frustration that hits newcomers to languages when reading tutorials is that tutorials are almost always written in the form of "do this, do this, do this and that happens".  They're paragons of perfect code.  There's no mis-steps, no errors.  You know, exactly the opposite of the experience that new users of languages have.  Fred takes the reader through pitfalls as a guided tour of the whole Erlang learning process.

The Organization

The book is written in a tutorial style with an eye toward easing beginners into the language.  The first part, chapters 1-9, deals with sequential programming in Erlang, giving details of language syntax, functional programming, error handling and a whirlwind tour of common data structures provided in the library.  Upon this foundation, then, is built the second part of the book in chapters 11-13 in which Erlang's concurrency model is dealt with.  Finally, the remaining chapters—14-30—deal with the massive OTP library suite that comes with Erlang.

 

The topics are introduced in easy steps for the most part, and concepts are built up in stages so that even the most complicated portions of it (I nominate the release and relup/appup sections for this distinction!) involve as little confusion as possible.  (There will still be some: Erlang is a very strange language from the beginner perspective and OTP is a very large, very complicated library suite.)

 

In many places there is extra information provided (c.f. the Kool-Aid below for an example).  These digressions from the main text are carefully noted and set apart so that the unbroken tutorial content is still easy to follow, but supplemental information is still placed topically.

The Content

This is a book that's jam-packed with code.  The code directly illustrates the points being made in the text.  Because Erlang is so concise in syntax, however, compared to languages like C++, Java, etc. you never get the feeling from this book as you do from so many others that the code is filler designed to bulk up the page count.  It's over 600 pages in length, but I do not feel, while reading it, that I've been ripped off by bulking code.  Instead I get well-written technical explanations interlaced with appropriately-sized snippets of code to illustrate things.

Dont Drink Too Much Kool-Aid

That's actually a thing in LYSE: sidebar content that is headed "Don't Drink Too Much Kool-Aid".  Far too many technical books (including the book which inspired this one) read as if they're written by uncritical fanbois with limited experience of other ways of thinking.  (This may or may not be the case in actuality, but it's the way they read.)  Fred, on the other hand, litters his book with warnings that you shouldn't view Erlang as a programming panacea; that perhaps sometimes other languages or other approaches may, in fact, be a better choice than Erlang.  This lends the text some moral authority as well as technical authority, in my opinion, and is a valuable part of the text.

The Bad

I love this book but it has its flaws like any work.  I'd be remiss if I didn't point them out.  Well point it out at any rate.  I really only have the one criticism of substance.

Verbosity

This book is an ox stunner.  I haven't yet got the dead tree edition, but seeing that it's over 600 pages long this would be one very intimidating book to brandish against, say, a robber in your home.  I can only imagine how threatening it looks held up to a newcomer to the language as a "beginner's guide".  Back when LYSE was just a web page it was a good place to point beginners to as it delivered its information in bite-sized chunks for the most part.  (Indeed in #erlang it is common to point to the specific page covering a newcomer's question.)

 

The sheer volume of text is, of course, a result of Fred covering seemingly everything in the language and its ecosystem without glossing over the sometimes-painful details.  This is a tribute to his integrity and his knowledge, but I can't help but wonder if in the process of publication it couldn't have been split into two books: a less-threatening introduction and a book oriented more toward the intermediate user.

The Ugly

As is usual, there are things you can see in a work that don't fall into the "good/bad" divide because they primarily fall into the realm of personal taste.  A review needs to document these as well as the more obviously good and bad things.

Quirkiness

This book is not an academic textbook, nor is it a "professional" technical manual (where "professional" seems to be equated with "mind-numbingly boring" in most circles).  The tone is chatty.  There are jokes throughout the work (Chapter 15 is entitled "Rage Against the Finite-State Machines" for example) and it is liberally illustrated with Fred's slightly warped cartoons.

 

In my opinion the jokes, the oddball examples and the cartoons do not detract from the value of the surrounding technical text, but I know of at least one person who found the tone and the jokes to be highly distracting and off-putting.  If you think this is potentially an issue for you, take a look at the free online edition and decide before you shell out the cash.

The Free Version

This segues neatly into the second thing: there is a free online version.  You can even use the free online version to make your own EPUB-formatted ebook.  The web site, in fact, offers just a little bit more material than the published book.  Why should you buy the published book?

 

This is a choice that readers have to make.  Personally, my stance on it is that if you're just going to hack around for fun you should probably use the online version.  On the other hand, if you'd rather deal with a professionally-edited text rather than a text edited by well-meaning amateurs, you should probably get the No Starch Press edition.  If, too, you are using Erlang professionally and this book has made your life a bit easier you should probably pay for a copy since Fred sank years into the work for no money and No Starch Press contributed probably half a year themselves getting it properly formatted and professionally edited.  These people deserve payment for their work as much as you do.

TL;DR

Should you buy this book?  I'm going to have to give this a qualified "yes".  If any of the following criterion match, you should not buy this book:

  • You wrote the Erlang compiler or large parts of the OTP infrastructure.
  • You have been programming large-scale Erlang applications for a decade or more.
  • You think technical books should be dry like Knäckebrot and are morally wounded by chatty works as a result.
  • You find cartoonish drawings of squid with an incorrect number of tentacles so distracting you can't take the paired technical work seriously.

Pretty much anybody else who is interested in Erlang will find something in this book that is both useful and enjoyable to read.

Filed under: , ,