Keep the Build Clean

From WikiContent

Revision as of 16:19, 28 October 2008 by Jhannes (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

Have you ever looked at a list of compiler warnings the length of an essay on bad coding and thought to yourself: "Man, I really should do something about that, but I don't have time now?" Have you ever looked at the single warning that suddenly popped up in your compiler and just gone about to fix it?

When I start out a project, there are no warnings, no clutter, no problems. But as the code base grows, if I don't pay attention, the clutter, cluft, warnings and problems start piling up. When there's a lot of problems, it's much harder to find the real warning that I really wanted to read among the hundreds of warnings I didn't care about.

To make warnings useful again, I use a zero-warning tolerance policy. Even if the warning is irrelevant, I fix it. Otherwise, I will have to decide that it's irrelevant every time I encounter it. If there are warnings I just don't care about, I turn them off in my IDE. Ignoring things is mental work, and I need to get rid of all the mental work I can.

Warning from your compiler and from your code are useful. You just need to get rid of the noise to start noticing them.When something appears that you don't want to see, fix the code. Don't wait for a big cleanup. Fix it right away.

Warning from your compiler are useful. You just need to get rid of the noise to start noticing them.

By Johannes Brodwall

This work is licensed under a Creative Commons Attribution 3

Back to 97 Things Every Programmer Should Know home page

Personal tools