Matthew Jones recently wrote a blog article titled Be The Laziest Programmer You Can Be. I like Matthew's articles, and I like this one in a way, but I'm going to make a case that Matthew's completely wrong in his definition of lazy. This is one of those subjects that rankles me, kind of like computer people routinely misusing the word "deprecate."
The traditional statemnent of Matthew's gist is:
If you want to find the most efficient way to do a job, give it to a lazy person.
Matthew states his thesis as:
lazy programmers want to do as little work as possible right now. But they also want to do as little future work as possible,...
He's absolutely right about the first part, doing as little work as possible right now. But he's absolutely wrong about the second, that lazy programmers are concerned about the future. They aren't, that's the problem. And, they're not efficient, they just get by.
Let's hit the dictionary first.
adjective, la·zi·er, la·zi·est.
- averse or disinclined to work, activity, or exertion; indolent.
- causing idleness or indolence:
a hot, lazy afternoon.
- slow-moving; sluggish:
a lazy stream.
- (of a livestock brand) placed on its side instead of upright.
verb (used without object), la·zied, la·zy·ing.
5. to laze.
"Averse or disinclined to work." This isn't decisive, because one could argue--as Matthew does--that a disincilation to work could extend toward future work. What does science have to say? [Emphases mine]
A person is being lazy if he is able to carry out some activity that he ought to carry out, but is disinclined to do so because of the effort involved. Instead, he carries out the activity perfunctorily; or engages in some other, less strenuous or less boring activity; or remains idle. In short, he is being lazy if his motivation to spare himself effort trumps his motivation to do the right or expected thing.
Other aspects of laziness that are discussed in a brief review of the psychology:
- Procrastination "Laziness and procrastination are similar in that they both involve a lack of motivation. But, unlike a lazy person, a procrastinator aspires and intends to complete the task and, moreover, does eventually complete it, albeit at a higher cost to himself."
- Evolution Our nomadic ancestors had to conserve energy to compete for scarce resources and to fight or flee enemies and predators. Expending effort on anything other than short-term advantage could jeopardize their very survival.... it made little sense to think long term.
- Effort and Reward "In most cases, it is deemed painful to expend effort on long-term goals that do not provide immediate gratification. For a person to embark on a project, he has to value the return on his labour more than his loss of comfort. The problem is that he is disinclined to trust in a return that is both distant and uncertain. Because self-confident people are more apt to trust in the success and pay-off of their undertakings (and may even overestimate their likely returns), they are much more likely to overcome their natural laziness."
- Fear of failure. "Many people get in their own way by postponing the pursuit of goals,""
- Fear of success. "This cousin of the fear of failure is very real: Many people are unconsciously worried that they’ll succeed in ways potentially threatening to others. So they avoid conflict by not moving forward."
- Desire for nuture. "some of us don’t know how to ask for what we want directly—so we act useless as a way of getting others to do things for us."
- Fear of expectations. "One of my patients rarely made plans and established herself as “lazy” so that other people would plan for her."
- Passive-aggresive communication. "People who avoid conflict often bury their dissatisfied feelings. They may communicate them indirectly through “laziness,” slacking in a way that will upset another person."
- Need for relaxation. "Many people erroneously assume that they should always be going full steam, and chastise themselves for being “lazy” when their body and mind shut down in protest."
- Depression. "In criticizing himself for “laziness,” a man may miss signs that he is depressed and needs treatment."
This picture of laziness is much clearer. According to established social and science understandings, a lazy person:
- Avoids doing hard work now, and so does the easiest thing he can get away with.
- Isn't influenced by (or concerned with) future consequences.
Here are some attributes of a lazy developer1:
- Doesn't write thorough unit tests. Tests, if written, allow him to fit the requirement, but don't catch enough problems.
- Doesn't use consistent naming conventions. He uses whatever occurs to him at the moment.
- Only updates Scrum/project estimates and completions if pushed to do so, and probably days after the fact.
- Makes no or cursory source control comments upon commit.
- Source code only works on his machine, unless he's been forced otherwise through continuous integration.
Is Matthew a "lazy" programmer? No, of course, not, but now I'm in for a pound so let's go through his article point-by-point.
"why don't I hear you typing?"
Matthew got in trouble for being lazy for not typing enough. This was a management failure, pure and simple. And it's proven by the company having an overtime-oriented culture. I'll bet they were lazy because they weren't planning ahead, as Matthew was. That guy was wrong and a jerk.
Lazy programmers are good programmers. They don't do more work than absolutely necessary.
No. The confusion here is in the word "necessary." For Matthew, "necessary" means "do it right so we reduce doing it again." Lazy programmers define "necessary" as "required by something external." Let me call this one out.
Refactoring doesn't exist for the lazy programmer. It's not in his vocabulary.
Lazy programmers abhor redundancy
Just the opposite. A lazy programmer will copy/paste code all day, because he's a) finishing more work right now, and b) doesn't expect to have to fix the code later.
Lazy programmers explain their decisions. They write thorough comments
Nope. Lazy programmers, concerned only with the present, see explanations as a waste of time. "Working" code should be good enough, they reason.
A lazy programmer is not attached to his future self.
Lazy programmers automate everything that can possibly be automated
That would take foresight. I've seen this repeatedly, programmers who are too lazy to encapsulate a method, or write a utility to automate. They'll instead do it the long, hard way every time. Their justification? "Writing that utility will take too long!" (This thinking is further exacerbated by deadline-oriented management.)
Lazy programmers teach people more junior than them, partially so those junior people can do the work instead.
Half of this is right. Lazy programmers want to get other people doing their work. But the way they do it is to claim they're too busy to fix their own code, and too busy to explain clearly, so just figure it out.
Lazy programmers expect to be replaced.
Well, they should expect this, but are not only surprised when it happens, but also angry, because they think they're doing what was expected.
Be lazy. It's OK.
No, it isn't, because you're not. Programmers!, don't conflate laziness with other problems. And don't beat yourselves up, either! Get help with beliefs and root causes. Learn to value strategic thinking, to give yourself a positive boost about creating that automation utility. To see your future self grinning like mad and saying "This used to take the other guy four hours. I automated it and it's done in four minutes."
It [laziness] takes practice,
It should be pretty clear by now, but lazy people don't practice. I play violin. I'm prety good. But one reason I don't play violin really, really well is because I only practiced enough to get by. (I also didn't know about deliberate practice, but that's another story.) A lazy person, by definition, avoids effort.
Excellence requires continual effort
Is Laziness Bad?
No. Well, maybe. The behavior's not helpful, and often harmful. The thing is, lazy people aren't bad. It's not a disease, and it's not a character or moral defect. As noted above, there are people who get huge amounts done, but if they rest they demean themselves as lazy. That's unhealthy.
Laziness is a habit. And habits can be broken.
Then What is Matthew Jones?
That's pretty easy. Matthew is an effective developer. All of the positive traits he ascribes to laziness are in fact hallmarks of high-performing software engineers. Matthew:
- Is concerned with how his current actions impact his future self.
- Is likewise concerned with making his code easier for other developers.
- Plans. Then executes. Then reviews and improves. He practices kaizen. He refactors mercilessly.
- Coaches others and, I hope, is always willing to be confronted with opposition, otherwise I probably wouldn't have taken the time to write all this down. Because, Matthew...
- Is wrong about what it means to be a lazy programmer, and I hope he revises his pitch. It's great to help programmers not be lazy, but I don't think redefining a word to mean its opposite is a good idea.
Matthew, I have a feeling I'd like you if we sat down for a beer. If you're ever in Denver, let's find out. You take your craft seriously, and have a light-hearted writing voice. It's from that mindset that I'm telling you, firmly, kindly: Matthew, buddy, you are not a lazy programmer!
Sorry that these are all in the masculine. Unfortunately, 90% of programmers are guys, so I'm writing to the majority audience.↩