Most of the time, when I’m learning a new programming language or framework, I’ll look for a quick interactive tutorial. My goal is to experience the language in a controlled environment. If I want, I can go off script and explore, but I’m basically looking for a quick jolt of caffeine, a snapshot of syntactic sugar, and core concepts.
But usually, the experience is not fulfilling. If I want to get the true flavor of a language that is more than a subtle extension of one I already know, a short tutorial is never going to work. I need a deep, fast dive. This book will give you such an experience not once but seven times. You’ll find answers to the following questions:
What is the typing model? Typing is strong (Java) or weak (C), static (Java) or dynamic (Ruby). The languages in this book lean on the strong typing end of the spectrum, but you’ll encounter a broad mix of static and dynamic. You will find how the trade-offs impact a developer. The typing model will shape the way you attack a problem and control the way the language works. Every language in this book has its own typing idiosyncrasies.
What is the programming model? Is it object-oriented (OO), functional, procedural, or some type of hybrid? This book has languages spanning four different programming models and, sometimes, combinations of more than one. You will find a logic-based programming language (Prolog), two languages with full support for object-oriented concepts (Ruby, Scala), four languages that are functional in nature (Scala, Erlang, Clojure, Haskell), and one prototype language (Io). Several of the languages are multiparadigm languages, like Scala. Clojure’s multimethods will even let you implement your own paradigm. Learning new programming paradigms is one of the most important concepts in this book.
How will you interact with it? Languages are compiled or interpreted, and some have virtual machines while others don’t. In this book, I’ll begin to explore with an interactive shell, if there is one. I will move on to files when it’s time to attack bigger projects. We won’t attack large enough projects to fully dive into packaging models.
What are the decision constructs and core data structures? You’d be surprised how many languages can make decisions with things other than variations of ifs and whiles. You’ll see pattern matching in Erlang and unification in Prolog. Collections play a vital role in just about any language. In languages such as Smalltalk and Lisp, the collections are defining characteristics of the language. In others, like C++ and Java, collections are all over the place, defining the user’s experience by their absence and lack of cohesion. Either way, you’ll need a sound understanding of the collections.
What are the core features that make the language unique? Some of the languages will support advanced features for concurrent programming. Others provide unique high-level constructs such as Clojure’s macros or Io’s message interpretation. Others will give you a supercharged virtual machine, like Erlang’s BEAM. Because of it, Erlang will let you build fault-tolerant distributed systems much more quickly than you can in other languages. Some languages support programming models that are laser-focused on a particular problem, such as using logic to solve constraints.
When you’re through, you will not be an expert in any of these languages, but you will know what each uniquely has to offer. Let’s get to the languages.