In a classic example of what goes wrong in bigger environments, I wanted to knock up a quick tool to solve a problem. I decided to use Clojure because the solution involves data transformation from XML to JSON, so a functional approach makes sense. I also want to improve my Clojure skills, which are on the amateur side.
Leiningen is the natural lifecycle tool. I created my project, updated my dependencies in
project.clj to the latest version of the midje testing tool, and in fine TDD style wrote a quick sanity test, ran
lein midje and got a green response. Good work.
After some reading up on XML zippers in Clojure, I then made the timeless error of overconfidence by taking a big leap forward and writing a simple functional test that required a number of implementation steps, including coding and updating components and tools. Pretty soon, I was in Leiningen hell, getting meaningless exception stack traces, thrashing around trying different versions of tools and libraries, and commenting out increasingly large pieces of code until I found my issue—in about the second line I’d written. Lots of time wasted, no value delivered.
Moral to the story: when you’re in unfamiliar territory, you move faster if you take small steps.