Today was a pretty good day for me - programming-wise. Even though I wasn't too well (having trouble hearing in my left ear which is disorientating and makes conversation difficult), I feel the contentment of a day well spent.
So what made it a good day? Building stuff is the bottom line for me but that is a very broad term. Today, building stuff meant working with the Raphael library to make a graphic for a web app (a dynamic graphic, it's not just a logo); refactoring the backend of said web app and reading various tech news.
News first. I was mainly reading about the architecture of Datomic, which is a really interesting take on databases. I would say it looks like the most developer friendly database implementation (in terms of the aims of the project) combined with some pretty powerful and flexible storage. I'm not sure how deploying it would work out, given it uses SQL or some other key-value-capable backend so it really adds another layer to your app's architecture. The rationale page was music to my ears though so I will be trying out the free edition for sure.
The refactoring I worked on today was a bit of “technical debt” that had been hanging around for a while. It was as a consequence of not understanding how to split up and compose together templates (and partial templates, snippets) with enlive. I had another go at reading the tutorials and this time it just felt easy. They could definitely do with simplifying though. The reason this was so enjoyable was that writing and refactoring Clojure code is generally a very fun endeavour. I generally have a SLIME session open with emacs and I just recompile the code or compile the function I'm changing, then check those functions in the REPL in emacs. In other words, development can be very fast. Also, enlive is hands-down the best templating system I've ever used. It's great that it can be used both for templating and for web scraping (or in my case, integration tests checking the contents of DOM nodes).
Working with 2D graphics, such as with Raphael, usually involves some trigonometry and today was no exception. I really suck at trig so this was the main stumbling block. It really was very simple stuff - finding the coordinates of a point on a circle - but I've forgotten it all from school. I pushed through all that, scribbled furiously on paper until I convinced myself I knew what I was doing and by the end of the day I had shapes arranging themselves at my command - and even rotating them all slightly for every item in the list. Essentially I love it when things work, maybe not the first time, but before I get a headache - that's the happiness benchmark for me.
The secret underlying all this, and all that I haven't said, is there is no secret to developer happiness. If I'm anything to go by, we thrive on autonomy, creativity and problem solving. It is very strange that so many employers are averse to providing any form of autonomy to their developers because that has to put a damper on anyone's aspirations. At Digital Science we are generally encouraged to come up with ideas all the time and execute them. But one of the best aspects for me is how we're all able to hack on the infrastructure. See something that could be better? Fix it. If I couldn't mix working on UI stuff, web backends, databases, deployment (Chef) and frivolous fun then this wouldn't be nearly as worthwhile.