Wednesday, March 2, 2011

Practical Clojure

There are many different kind of technology books. Some books introduce the reader to a specific technology or to a concept. Some books are references, some teach the basics of programming (or some other elementary concept). Some books do more things at once.

Some books last. When a book does not teach a specific technology (that is transient, by its own nature, and changes) but a broad concept, they are more likely to last (perhaps with minor modifications). The books I love most are part of the second category.

A particular category of technology books are the ones teaching new programming languages. If the programming language is a good one, the books tend to lean towards the second category, the one of books teaching broader concepts, even though perhaps they need more frequent updates, as languages evolve.

Perlis said that: "A language that doesn't affect the way you think about programming, is not worth knowing." And I could not agree more. Some languages improve your programming in every other language. Lisp is one of such languages. Nice dynamic OO languages don't do that automatically, but in the hands of a careful programmer, they have the same effect.

So, if the language is good and the book teaches you how to actually think in the language, how to use its proper abstractions, then it is teaching you something noteworthy. Unfortunately, sometimes there is so much language to teach, that there is no more space for anything else (C++?). Moreover, some languages just teach programmers to thing the wrong way (C++, Basic).

But this does not really concern us, as we are going to talk about Clojure. Clojure is a wonderful language (even though I actually favour Common Lisp).

Right at the moment, there are two book on Clojure. I already reviewed Programming Clojure in a previous post. The "other" book about clojure is "Practical Clojure".

From a typographical point of view, Practical Clojure sucks. I just hate the way APress books are typeset. I hate the fonts. I hate the spacings. It looks to me as it was paged with word. On the other hand, I rather like the Practical Bookshelf paging, indeed. Still, I find I prefer more the typesetting of some more traditional editors (e.g. On Lisp, most stuff from MIT Press, or even some newer stuff such as NoStarch Press Land of Lisp). But of course it is content that matters.

Practical Clojure uses a newer version of clojure and that is an advantage, of course. A part from this, it is another introductory book on clojure. There is a wide intersection area on the subjects, but the two books have some differences.

Practical Clojure introduces Java interoperability at the end of the book and that means that most examples are "pure clojure" and some central chapters can be used as a reference. Consequently I sometimes read through Practical Clojure even now. I also find some explanations more thorough.

On the minus side, there are fewer long length examples. Consequently, it is harder to figure out Clojure pragmatics. I believe that we really need a different breed of books. Practical and Programming Clojure basically show us the basic Clojure constructs and how to use them. They are introductory books on Clojure (and we need these books as well).

I believe that we need books that build on those two to go deeper. Some books on Lisp are old, but still teach the abstract principles of Lisp programming. Consider for example Graham's books, or PAIP. We need something like that for Clojure. In fact, I'm looking forward to read Joy of Clojure.

Amazon Associates Link

Technorati Tags: , ,

6 comments:

Unknown said...

I read Joy of Clojure after Pratical Clojure, I think it's a very good book.

It tells when something is idiomatic more than the other 2 books.
Last chapters are out of my comfort zone, and I think it's something good.

It hasn't long example like LoL, but it's good for my short concentration span.

Unknown said...

I need the paper version in order to read it. I love electronic references, but to read a whole book I still need good old printed book.

You are basically confirming my impression about JOC. I'm looking forward to read it.

Besides, as far as I could tell from the TOC, I thought that the last chapters would not be the hardest. Performance tips are usually "easy" to grasp and discussions on DSL tend to be easy to understand (and difficult to design).

I usually find the hardest parts in books the one regarding core "hard" stuff. E.g., intricate template meta-programming in C++, call/cc in scheme, parallel system design in Erlang, Monads in Haskell... that kind of stuff, I mean.

So for example I expected that the harder chapters were the one about macros and perhaps the one on state and concurrency.

Unknown said...

I forgot... I like to point out that I don't' consider """It tells when something is idiomatic more than the other 2 books.""" as a defect of the other two books.

Rather its part of being "introductory books" more than JOC. E.g., would JOC be a good "first book on clojure" and for whom (e.g., old lisp hackers yes, oop java enterprise super uber-architects no, etc)

Alfredo said...

I've took the chance to save about 40% on MEAP ebook + printed book (whenever it will be available) on S. Valentine day.. So I'm reading my personal-generated JOC MEAP version, looking forward to read (and collect!) the printed version!
Ah, the sweetest s.valentine's day of my whole life hahahahaah
Bye Enrico
A.

Unknown said...

Ah... If I only knew, I would have bought it. Perhaps my girlfriend would have been less than happy about me talking about clojure rather than saying romantic things.

Anonymous said...

I've purchased Practical Clojure, The Joy of Clojure, and most recently Programming Clojure. I have a lot of programming experience, and have used languages from PL/I and Bliss to C, C++, and Python, but never a Lisp dialect.

Of all the books I have, Programming Clojure does the best job at jumping in and pulling a problem apart and tackling the problem in phases, just as you would improve your code in the real world.

I am glad I've purchased the other two books, because they are well written. However, for someone with no Lisp background, I believe Programming Clojure is the best starter book.