06 Dec 2015
On clojureX this year we almost had a panel discussion on editors; it was cancelled at the last minute unfortunately. So I thought why not publish the longer version of the screencast I prepared demonstrating how to use some clj-refactor features in Emacs to clean up a messy namespace.
06 Feb 2015
Lately I came across a vanilla java solution for the good old fizzbuzz problem. This gave me the idea to try (finally) the java8 stream API: fizzbuzz seemed a small but fitting problem. And while at it why not code up a solution in clojure too so I can compare the two. This post documents the one afternoon adventure.
16 Jan 2015
An automated regression test suite is a very valuable asset, however most of the times it does not come cheap. You need to write your unit and/or functional tests and add them to the regression suite and then, and this is the real pain: maintain them. Almost every single refactoring means some work on the test code too. We've found a way around this at the MailOnline, and get a really valuable regression test suite for cheap. Perhaps it's worth to share the details.
05 Jan 2015
24 Mar 2014
The project clean mentioned at the end of the previous post got integrated into clj-refactor and changed a bit during the process. Just a quicky about the code.
16 Mar 2014
clj-refactor is a very lightweight elisp library for Emacs to support every day refactorings for clojure. I've even read that it is an über-paredit: kinda fair. It definitely melds into the editing experience defined by the mix of cider, clojure-mode, paredit well. Adopting it you get loads of nice transformations which help you with your every day clojure coding. There are simpler ones like add require to namespace declaration
ar and cycle collection type
cc or cycle privacy
cp. This latter sounds silly first: why an earth you would not just go to your
defn and add that '-' to make it private. But once your muscle memory has remembered
cp it is just natural to turn a function private with one easy key combo when you figured out it does not make sense to keep it public -- you don't even need to think about what to press. There are more arcane ones which give the wtf-just-happened-with-my-code experience first but then they start making absolute sense. The threading macro related ones for example: wrap in thread first
tf and fully unwind threaded expression
ua or the introduce let, expand let, move to let triumvirate. Used in a correct way the latter one helps you to handle let expressions in a very clean way across your code. These are only examples of course, check out the full list on the project's really cleanly written github readme.