7 Languages in 7 Weeks. Book review
I already mentioned a couple of times that I’m new to functional programming. My fascination has a very precise starting point. It was thanks to a book “Seven languages in seven weeks” by Bruce A. Tate. I found out about the book somewhere in October 2011. It was yet another publication from Pragmatic Bookshelf series that I wanted to read. As the title suggests, it presents a guide to seven programming languages and I knew none of them: Ruby (“It’s something like Python, I guess”), Io (“WTF?”), Prolog (“How does programming in logic look like?”), Scala (“Oh, a friend uses it so it must be practical”), Erlang (“Oh, I heard it’s something like Haskell”), Clojure (“I think I heard something about this LISP thing…”) and Haskell (“Oh, I heard it’s something like Erlang”). So generally I had no clue what these languages are, but I knew I’d like to learn them, especially that I haven’t learned any new language for about 2,5 year. David Thomas and Andy Hunt in “Pragmatic Programmer”, that is a modern programmers bible - if you haven’t read it yet go grab a copy, I’ll wait - recommend that a programmer should learn new language every six months. Looks like I had a lot to catch up. And then somewhere in the beginning of December I found Polish edition of “Seven Languages in Seven Weeks” in a book store. I couldn’t miss such an occasion.
The idea of learning a programming language in one week is a bold one. Learning seven languages in seven weeks seems even bolder. Bruce Tate says it outright: reading the book will require a lot of work and assumes readers good knowledge of programming in general. And it really does. The first language, Ruby, was rather easy, mostly because it is similar to languages I already know. The second language, Io, was my personal failure. I could not grasp it. Despite it’s simplicity I had problems understanding the basic concepts of the language (mostly passing messages) and the official documentation offered little help. This discouraged me a lot, but luckily the next language, Prolog, turned out to be extremely fun. In fact I put down the book and started reading online tutorial on my own. From it I learned about tail recursion using accumulator. Language number four was Scala. I was looking forward to learn it, as I’ve already heard some stuff about functional programming. Unfortunately, Scala turned out to be disappointing to me. Not that it’s a bad language. I think it can be great, but I wanted to learn functional programming. Scala, being a hybrid language - both object oriented and functional - didn’t provide me with good clues where the object programming ends and the functional begins. I liked the concept of folds, though. Erlang was next. I liked it because of it’s similarity to Prolog, but honestly speaking I didn’t put much effort into learning it. Following Erlang was Clojure, a dialect of LISP for the JVM…. ops, I skipped that chapter of the book! Seriously, I did. I wanted to learn LISP and in some strange way I drifted away from Clojure to Scheme. I’ve read the R5RS language specification and The Little Schemer - I’ll definitely write about it on this blog. Finally came Haskell. I was anxious to learn it and I must say that the purity and logic of this language keeps me fascinated for the last three months
Ops, I strayed away from the book itself. Well, the book’s nice but I’ve certainly read better ones. In fact if I were to rely only on it I wouldn’t learn much. Many topics are covered very superficially (good luck understanding monads!) and to fully understand them I had to spend hours reading tutorials on the web. I realised that when I was learning Erlang I just started reading Learn You Some Erlang for Great Good and after completing eight chapters from it I read the book only to conclude that I already know all of that. But I think that’s irrelevant. I think that the most important thing about “Seven languages…” is the fact that it’s motivating. It made me learn languages on my own and that’s great, cause I haven’t done it for such a long time. It also exposed me to the basic concepts of functional programming and I am thankful to Bruce for that. To me it was one of the most influential books in my programming career, but honestly speaking you can do without it and learn these seven languages just as well, providing that you can keep yourself motivated.
P.S. While I was reading the book I found Ben Nadel’s blog to be very supportive. P.S.2 This is not a concern for most of you, but I found the Polish edition of the book to be poor. Translation is sometimes wrong, unclear or hard to understand. Code listings contain lots of mistakes, including translating some of the language keywords.