Imperative thinking and the making of sandwiches

People regularly tell me that imperative programming is the natural form of programming because ‘people think imperatively’. I can see where they are coming from. Why, just the other day I found myself saying, “Hey Chris, I’m hungry. I need you to walk into the kitchen, open the cupboard, take out a bag of bread, open the bag, remove a slice of bread, place it on a plate…” Unfortunately, I hadn’t specified where to find the plate so at this point Chris threw a null pointer exception and died.

Read on →

Pain we forgot

Much of the pain in programming is taken for granted. After years of repetition it fades into the background and is forgotten. The first step in making programming easier is to be concious of what makes it hard. So let’s put ourselves in the shoes of a smart but inexperienced end user trying to build, test and maintain a simple application.

Read on →

Local state is harmful

Don’t lynch me just yet :)

Read on →

We’re not even trying

Light Table has a feature called watches, where you select an expression to watch and behind the scenes the editor wraps that expression in some code that sends the results back to the editor every time the expression is executed. You can also write custom watches that wrap the selected expression however you like. For example, this watch displays the time the expression took to execute.

Read on →

No more bullshit

We are doing programming wrong. We all know it. Sure, if you sweat and scrub and shine and polish and pray to the gods of TDD you can get stuff done, but in the back of your mind you will always hear Zed Shaw’s voice whispering “This is bullshit!”. We cannot build the world on a foundation of bullshit.

Read on →

Hugo-a-go-go: optimisation

After a little optimisation work hugo now manages to play out ~12k games per second on a 9x9 board. Besides fixing the two incorrect optimisations I made during the last minutes of the competition, the main wins were changing the board representation and carefully inspecting the compiler output to eliminate unneccesary work. A lot of the things I discovered are generally applicable to calculation-heavy, cpu-bound cljs code (with all the usual disclaimers about profiling and premature optimsation).

Read on →

Hugo-a-go-go

For the 2013 Clojure Cup myself and Tom Hall wrote a go AI in clojurescript, inspired by pushkin. The source is here and it can currently be played on the clojure cup site (only tested in chrome).

Read on →

Flowing faster: lein-gnome

After several weeks of banging my head against the empty space where the gnome-shell documentation should be, I’ve finally revived technomancy’s lein-gnome. It can build, package, deploy and reload gnome-shell extensions and includes a hello-world template. I’ve also added a unified log watcher that hunts down all the various places gnome-shell might choose to put your stack-traces and a cljs repl server that runs inside your extension so you can trial-and-error your way to victory.

Read on →

Flowing faster: foundations

I’ve spent the last few years using Gnome 2 and xmonad on Ubuntu. Since both Ubuntu and the Gnome foundation have dropped support for Gnome 2 I’m going to be forced to upgrade sooner or later. Fortunately I have a two week holiday followed by a new desktop at my new job, so now is a good time to break things on my laptop.

Read on →

Flowing faster: saving the cloud

While we’re on the subject of backups – like most people, I rely pretty heavily on cloud services. It sort of snuck up on me. I’m generally trying to move towards using cloud services as dumb servers so I can easily replace them. The first step is to be able to export and backup all my data.

Read on →