Clojure In Action MEAP
Buy it now
One Minute Bottom Line
|The MEAP copy is less than half-finished (at least by chapter count) but still gives an introduction to the Clojure language in a way which helps understanding and adoption rather than just being of academic interest, and chapters to come promise practical information for programmers who want to use Clojure in the real world.|
ReviewEarlier books on Clojure, such as Programming Clojure by Stuart Halloway, suffered at the time from the fact that the language had only just attained a stable 1.0 release and was still in flux. Clojure In Action suffers far less from that problem, with Clojure now having a stable 1.1 release and a soon-to-be-released 1.2 the book is likely to endure change better than its predecessors.
Only 9 of the proposed 20 chapters were completed at the time of review, and these early chapters focus more on the Clojure language than the "in action" part of the book will. The language description chapters are concise but informative, often taking time to explain the background to some of the more esoteric design choices in the language and commenting on why something is the way it is rather than just presenting the facts. With Lisp (and Clojure by association) being a difficult language for many from an imperative background to adjust to, this extra information helps a lot in understanding how to use the language effectively. Clojure basics - program structure, program flow, defining clojure functions and data are covered in the first three chapters. Clojure's approach to polymorphism (multi-methods), interoperation with Java, and macros in the next few.
Of particular interest to anyone learning Clojure as a new language is the chapter on state management and concurrency. The Clojure language introduces a variety of new and different ways of handling state in concurrent applications, enough that trying to decide which to use under what circumstances can be a difficult choice to understand - again, particularly if you come from the Java threads and locks world. While the explanations and examples of the various state & concurrency management constructs are as effective as any, it's the first few sections of this chapter - explaining the problems with state, identity, time & values - that make the chapter stand out. As with a lot of the rest of the book, if you understand the problem first then the solution doesn't seem contrived when it is presented, and this is where the book, as a whole, scores in its approach.
From Chapter 8 onwards, we start to move into more practical applications of Clojure with details of the clojure.test TDD library and data storage using clj-record. Later chapters will cover topics such as building web-based applications, using messaging, scalable data storage, web services, DSLs and event stream processing. They will be reviewed as and when they become available.
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)