Computer Science has ideas that are important to the broader world. The most important is the Universal Turing Machine. From one perspective, Lisp embodies the idea at its core. To really understand how, I ask you to implement your own Lisp interpreter.
`clojure.core/reduce` is a powerful function, yet the code for it is so simple. It's four lines! We TDD our own implementation.
A deep-dive into a single reduce example shows how much can happen in a short bit of code.
Learning to write map is a good lesson because it has recursion, list building, and higher order functions. It's everything that makes Lisp great.
map is one of the staples of functional programming. It's totally useful and also surprisingly simple. Let's look at some examples and annotated code.
reduce is a very useful function. You can use it for many calculations over a collection. Code annotations are useful, as are physical metaphors.
The structure of our data should match the relevant structures in the real world. And to ensure that our data is structured well, we should reduce the potential for incorrect structure. Variants provide a great solution for it.
If naming is one of the two hardest things in programming, it follows that every other possible solution (except those few involving cache invalidation) should be attempted before naming something. As a corrolary, bad names are a code smell.
The Google Closure Library provides a nice interface to the HTML5 History API. Coupling it with Secretary is very easy. But not all browsers support HTML5 History. In this post I'll talk about one way to make sure you have client-side routing in all browsers.
Setting up and tearing down a test database can be slow. Use a rolled back transaction to quickly reset the database to a known state. You can do that in an `:each` fixture to run each test in isolation.