“hold off on thinking that programming without an assignment statement has to be crazy hard–it’s part of this book’s job to show you it’s not.”
What did we read about?
This week we started our second book, Functional Programming for the Object Orientated Programmer.
Chapter 1 – Up to 1.10 Lists
After the rapid pace of our last book, we are taking things slow and steady as we get to grips with Clojure and functional programming. As you would expect, the opening chapter of the book introduces Clojure and the options you have for setting it up on your machine (IDE or command line tools like Leningen).
Following this the author covers all the basics, including defining functions and handling the list data structure. The exercises at the end are very basic but help to ensure you have a good grip of everything that was covered so far.
In start contrast to the approach taken in the “Well Grounded” chapter this short introduction focuses more on how the REPL is implemented than how it is used. It talks about evaluator is anthropomorphised as a lazy little bird eating up parentheses, tokens and symbols. There are many pictures but it doesn’t seem to cover a lot of ground. The exercises seem rather simplistic – returning the second and third elements in a list. The introduction is focusing on how the functional code’s execution style is different to the object oriented apporach the reader is used to.
What stood out?
- The Clojure REPL (Read-Eval-Print Loop) walkthrough, including an easy explanation on how it actually works.
- Thinking of functions as ‘values’ and embracing pure immutability.
If you read nothing else this week…
- Check out Light Table which has an excellent ‘Instarepl’ feature which is great for beginners and experts alike (neat video demo here)
- If you already know the functional basics you can skim most of this weeks content. It’s just a simple introduction to the REPL.
- If you’re new to functional languages then you need to work through this text carefully. The ideas being introduced are simple but fundamental to understanding the rest of the book.
- If you need to take more time learning the Clojure Language then check out Clojure Made Simple. It was written by our very own John Stevenson. He knows a thing or two about real world Clojure. John’s approach to introducing Clojure is far more practical than this weeks chapter.
- Rich Hickly, the creator of Clojure, has an excellent presentation on InfoQ called “Simple Made Easy.” In it he talks about the design philosophy behind the language.