Tags

, , , , , , ,

I’m really enjoying my new job at the intersection of academia and technology, and it’s made me want to improve my technology skills. So I’m now preparing for a Master’s degree in computer science, learning to program in modern computer languages. I’ve been trying to think about how to be a good programmer, and looking up some advice on the web. Of course people’s assessments of good programmers are widely different, but there’s one surprising claim that comes up quite a lot: a good programmer is a lazy programmer.

This is the point where programming becomes philosophically interesting. It’s not a new rhetorical move to take something usually considered a vice and call it a virtue, of course. Ayn Rand – a philosophical hero to many programmers, I might note – entitled one of her essays (and essay collections) The Virtue of Selfishness. On the topic at hand, Bertrand Russell spoke many decades before In Praise of Idleness. But while the move is not original, it is nevertheless effective. It almost forces us to start doing philosophically, to start thinking about big questions and ultimate ends, because we can no longer assume what we took for granted – that selfishness or laziness is a vice. Even if we reaffirm our original view, it is not quite the same now that we have allowed it to be called into question.

I especially like the move of giving an ostensible vice the name of virtue because it helps highlight what I find one of the most crucial ethical themes of all: the Aristotelian mean, the idea that virtue is a matter of occupying the right middle ground between two vicious extremes. We’re directed toward the vices because they each have some good in them; the badness of one vice lies in the fact that we ignore the good in its opposite. I find justice as good an example as any: we need to take the interests of others into account, but also need to stand up for ourselves. Hugo Grotius had criticized the idea of justice as a mean because he thought there was nothing wrong with asking for too little. But I think part of Rand’s widespread appeal is that she recognizes there is something wrong with excessive self-sacrifice, with meekness and submissiveness – though I would argue she then finds herself stuck at the opposite extreme.

Now to the topic at hand: laziness. It is a commonplace to view hard work or industriousness as a virtue. And there’s a truth to that view, in that hard work is associated with the genuine virtue of self-discipline or temperance, of being able to put aside the desires of the moment and think toward the longer term. But hard work is not an end in itself, especially not work for pay, alienated work. An old quip says “Nobody ever died wishing they’d spent more time at the office.” Yet too often we treat paid work as if it is its own end, and as a result we work too hard. This is especially the case in the United States, where it is common even for highly skilled workers, workers in high demand, to be allowed only two weeks of vacation a year – and sometimes, shockingly to me, they don’t even use those two weeks. The US is also the land of convenience, of 24-hour stores and frozen pizza, which allow one to save a great deal of time; the problem is that that very saved time tends to get funneled back into more paid work.

I’ve discussed this much before; it is the key reason I am not a right-winger. And again, Russell overall said it better than I have. I mention it to show one way in which laziness, or at least something often called laziness, can be a virtue: the proper recognition that we have worked enough, that it is time to play.

The computer programmer’s virtuous laziness is related, but slightly different. What has struck me about computer science in my limited studies to date is how deeply devoted it is to efficiency. The study of data structures and algorithms – the theoretical underpinnings that make computer science different from mere programming – is all about making a computer accomplish tasks using as few of its resources as possible. But good programmers take this a step further. Good programmers are lazy because they try to make a computer accomplish tasks using as few of their own resources as possible. Rather than writing code multiple times to accomplish different but similar tasks, they create a data structure and algorithm that allows them to turn it all into one task, written once, that performs the task in different ways. The same or more results with less time and effort put in: that’s the programmer’s goal. “Work smarter, not harder.”

Or so one might hope. The software industry can be notorious for its long hours, especially in the game industry where many work 70-hour weeks or more. Here the programmer’s so-called laziness really is anything but. She has the exact opposite of Russell’s virtue of idleness; the irony is that she trains herself so that she could have that virtue. The programmer’s laziness turns out to be simply a variant on the basic problem of convenience. A good programmer doesn’t want to do repetitive tasks, so she programs in a way that saves time. That’s lazy, and it’s good. But what is that time then used for? A properly lazy programmer would be able to say: “I have accomplished a task that a less skilled programmer would have taken more than a 40-hour week to do, and I have done it in 20 hours. Now that I have done more than everything my employer expected for the week, I will go home and enjoy the fruits of my labours.” But the culture of the software industry rarely allows for this. Instead, the effect of the good programmer winds up being like that of the washing machine: work saved is merely an occasion for more work. Marx would not be surprised.