Some Annotated clojure.core/reduce Examples

July 21, 2015
reduce is a very useful function. You can use it for many calculations over a collection. Code annotations are useful, as are physical metaphors.

Reduce Complexity with Variants

July 08, 2015
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.

Avoid Naming at All Costs

July 05, 2015
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.

Mastering ClojureScript Routing with Secretary and goog.History

June 24, 2015
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.

How I made my Clojure database tests 5x faster

June 17, 2015
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.

TDD Workflow in Clojure using Emacs with CIDER

June 08, 2015
TDD is about fast feedback. CIDER tightens the feedback loop with quick commands for running tests and a powerful test reporting system.

Lambda Abstraction

May 17, 2015
Lambda abstractions are always leaky, but some are leakier than others. Clojure programmers recommend keeping most of your functions pure and containing the leaks as much as possible.

Infinite Application

May 17, 2015
Function application is a key concept in lambda calculus. While it is commonly expressed using parentheses in Clojure, it is also reified into a function which itself can be applied to another function.

But the World is Mutable

May 11, 2015
The world may be mutable, but people have been using the notion of immutability to build reliable systems for a long time.

clojure.test cheatsheet

May 03, 2015
I made a clojure.test cheatsheet that you can get for free.