Choosing the languages in this book was much easier than you might imagine. I simply asked potential readers. When we rolled up all the data, we had eight potential candidates. I struck JavaScript because it was too popular and replaced it with the next most popular prototype language, Io. I also struck Python because I wanted no more than one object-oriented language, and Ruby was higher on the list. That made room for a surprising candidate, Prolog, which was a top-ten language on the list. These are the languages that did make the cut and the reasons I picked them:
Ruby. This object-oriented language gets high marks for ease of use and readability. I briefly considered not including any object-oriented language at all, but I found myself wanting to compare the different programming paradigms to object-oriented programming (OOP), so including at least one OOP language was important. I also wanted to push Ruby a little harder than most programmers do and give readers a flavor for the core decisions that shaped the design of Ruby. I decided to take a dive into Ruby metaprogramming, allowing me to extend the syntax of the language. I’m quite happy with the result.
Io. Along with Prolog, Io is the most controversial language I included. It is not commercially successful, but the concurrency constructs with the simplicity and uniformity of syntax are important concepts. The minimal syntax is powerful, and the similarities to Lisp are sometimes striking. Io has a small footprint, is a prototype language like JavaScript, and has a unique message dispatch mechanism that I think you’ll find interesting.
Prolog. Yes, I know it’s old, but it is also extremely powerful. Solving a Sudoku in Prolog was an eye-opening experience for me. I’ve worked hard to solve some difficult problems in Java or C that would have been effortless in Prolog. Joe Armstrong, creator of Erlang, helped me gain a deeper appreciation of this language that strongly influenced Erlang. If you’ve never had an occasion to use it, I think you will be pleasantly surprised.
Scala. One of a new generation of languages on the Java virtual machine, Scala has brought strong functional concepts to the Java ecosystem. It also embraces OOP. Looking back, I see a striking similarity to C++, which was instrumental to bridging procedural programming and OOP. As you dive into the Scala community, you’ll see why Scala represents pure heresy to pure functional programmers and pure bliss to Java developers.
Erlang. One of the oldest languages on this list, Erlang is gathering steam as a functional language that gets concurrency, distribution, and fault tolerance right. The creators of CouchDB, one of the emerging cloud-based databases, chose Erlang and have never looked back. After spending a little time with this distributed language, you’ll see why. Erlang makes designing concurrent, distributed, fault-tolerant applications much easier than you could have ever thought possible.
Clojure. Another JVM language, this Lisp-dialect makes some radical changes in the way we think about concurrency on the JVM. It is the only language in this book that uses the same strategy in versioned databases to manage concurrency. As a Lisp dialect, Clojure packs plenty of punch, supporting perhaps the most flexible programming model in the book. But unlike other Lisp dialects, the parentheses are greatly reduced, and you have a huge ecosystem to lean on, including a huge Java library and widely available deployment platforms.
Haskell. This language is the only pure functional language in the book. That means you won’t find mutable state anywhere. The same function with the same input parameters will give you the same output, every time. Of all the strongly typed languages, Haskell supports the most widely respected typing model. Like Prolog, it will take a little while to understand, but the results will be worth it.
I’m sorry if your favorite language didn’t make the list. Believe me, I’ve already gotten hate mail from more than a few language enthusiasts. We included several dozen languages in the survey mentioned earlier. Those languages that I picked are not necessarily the best, but each one is unique, with something important to teach you.