The Joy of Doing Things Right for No Reason

Internet, meet Civet. It’s a piece of software I wrote that lets you write very simple scripts to run programs over and over again with different parameters. It came out of a project I’m working on that involves profiling the performance of an algorithm to solve differential equations. I realized that it would be useful to have code that could run through dozens or hundreds of different setups and determine how many iterations the algorithm took to solve each, but without the overhead of a full testing or CI system. If you need to do repetitive experiments with computer software, you should check it out. But that’s not why I want to talk about it now.

I want to talk about Civet because, if I’m brutally honest, it could have been a bash script. It should have been a bash script. I literally wanted to run the same program ten times in a row. That’s what bash scripts are for. One of my collaborators on this differential equations project was, in fact, planning on writing a bash script to do exactly what Civet does. It wouldn’t have been as elegant a solution, or as extensible, but it would have got the job done. Since it wouldn’t depend on Python, it might even have got the job done with fewer computational resources. Certainly, it would have been quicker to write.

With shell scripting the way it is, then, there isn’t any reason for Civet to exist. It’s probably for this reason that I’m inordinately proud of the code: it was a waste of time, but I did it anyway. Mathematics is full of this sort of attitude, and the purer the mathematician the more likely it is they will have some opinion about Frank Ramsey’s “meaningless marks on paper”. Most of the time, these sorts of discussions are concluded by saying that higher mathematics is an art as much as an applied science, and so should have less plutophilic standards for meaning than, say, engineering. Civet, however, is not art, not by any stretch of the imagination. Its main draw is that it works, not that it transports you to new heights of appreciation of the awesome power of the computer. In my arrogance I might call it elegant, but I would not call it artistic.

Rather, my pride in Civet springs from the joy of taking the time to do things right for absolutely no reason at all. This is a selfish joy: I only began the project because I, personally, felt not only like doing it but also like doing my way. The fact that nobody else felt it was important enough to get involved with just meant that I could do it exactly the way I wanted. It could be my private playground, and I could be sure that nobody would intrude.

Uniquely among selfish joys, though, I can feel this without having to hurt someone else: now that Civet does exist, there isn’t any reason for it not to. It does work better than a bash script. It makes our lives just that little bit easier. The fact that it took way too much effort to make does not change the fact that it was, although a poor investment of time, a net positive. Doing things right for no reason combines all the fun of being selfish with all the fun of being selfless, walking the line between the two.

Civet leaves me in a strange place. I should reget doing it. I really should, but I don’t. I don’t have a justification for it, but I don’t think I want one. If you decide to take the time to fully solve a problem, to find what you think is the best answer rather than just an answer that works that you think could still be improved, you have to justify that decision. You have to justify taking the time out from other commitments that you need to build your new solution. You have to justify using whatever resources you plan to use. Be that as it may, if everything you need is available, there is as much happiness to be found in building only slightly useful things as in building actual truly useful ones.

Written on June 28, 2020