Getting to the Root of the Problem

I don’t know about you, but I can’t wait for winter to be over.

I’m usually not so bad, but this winter I’ve had at least three, maybe four full-blown colds, which is unusual (I’m pretty consistent with my one cold a year, thank you very much).

I’m definitely in a different place in my life this winter than I have been previous years. My job requires relatively frequent travel and working from home, mostly. So how my friends and family respond when I tell them I’ve been sick is almost forgivable. Almost.

“Get out more.”

“Eat better.”

“Get more exercise.”

I’m sure you’re familiar with this scenario, and I can’t say I completely blame them for trying. After all, getting some sunlight, eating healthily, and exercising regularly are undoubtedly formulas for a healthy lifestyle. But what about the same logic applied conversely?

“If you get out more, your cold will go away.”

“If you eat more healthily, your cold will go away.”

“If you get more exercise, your cold will go away.”

I don’t know about you, but I’ve never been warned that eating a slice of pizza can actually cause the flu.

The real reason I’ve been sick is simple. Malicious bacteria or virus are in my body, rapidly multiplying and wreaking havok on my immune system.

So why does nobody say that? The correct response, if ever there was one, to “I’m sick” is “There are organisms within you, feeding off of your body and fighting your immune system.”

But the reason we divert from this fact is because it makes us feel powerless. It makes people feel so much bigger and stronger to blame their own habits than those of a single-celled brainless organism. People need to feel in charge, and there’s a whole lot of psychological science behind it that I don’t know enough about to get into.

But this same kind of failed and misguided logic is the same that governs a lot of what goes on in the tech world, too.

There are so many different possible “solutions” for bad code. Pair programming, Agile, XP, Waterfall, Scrum, Code Review, Conferences, Training, Books, Blogs, Workshops, Social networks, User groups, TDD, BDD…

The list goes on for so long, and it’s all bullshit, because if you’re consistently writing bad code it’s because you don’t know how to write good code.

There are definitely ways to ensure a good programmer writes good programmer code more often, but all of these “best practices,” when taken too seriously and to too far an extreme, become nothing more than failed logic.

“If you pair program, you will no longer write bad code.”

“If you eat salad instead of pizza, you will no longer have a cold.”

There is an infinite number of reasons or explanations for bad code, but if you’re finding that the code you’re writing isn’t as good as you’d like it to be, maybe it’s time to get to the root of the problem (you aren’t writing good code) and solve it (exercises, fundamentals, study, understanding the client’s problem or domain better, learning the design of your framework, etc).

This entry was posted in Business, Code. Bookmark the permalink. Both comments and trackbacks are currently closed.