Clean up a messy namespace with cider and clj-refactor...

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.


Java8 stream API vs Clojure fizzbuzzed...

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.


Webapp regression testing for cheap...

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.


Laziness driven changelogs...

05 Jan 2015

At the MailOnline we have not been doing microservices exactly but something definitely far from big, monolithic applications. This resulted in quite a few applications across the board. Many written in clojure or in node.js, javascript for the browser, or some other language. We developers take care of releasing our software which is perhaps the right way to go most of the times, using some CI tool and always trying to push for continuous delivery. Nevertheless the time had come when we were asked to provide some human readable information about the versions of the software we release. The request come from multiple sources: devs, devops and technical management all wanted this info. For a short time we could repel the requests by pointing people to our CI tool and/or gitlogs either in the command line or on github which we use to host almost all our projects -- rest is on bitbucket, just to make things even harder to track. On the top of that we use multiple issue tracking systems, yeah I know, don't ask: historical reasons. As these issues have very valuable information on what we are working on they should be referenced in these changelogs too.


Clean clojure files en masse continued...

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.


Clean clojure files en masse...

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.


RSS feed