I’m naming a new code smell today, “Obsessive Tracing.” You know exactly what I mean. If you see a long method or class with a *lot* of Debug.WriteLine(“1″) or Debug.WriteLine(“I’m in here now!”) methods sprinkled throughout the code, it’s a good bet the code smells to high heaven. Those trace statements are in there because the code is prone to breaking and hard to understand.
The point of a code smell is to recognize a problem so you can begin to move in a different direction. I’m not sure what you do with legacy code, but with new code the key in my opinion is a well factored solution for ease of understanding and strong unit testing. Excessive amounts of debugging often means your unit testing isn’t granular and comprehensive enough. Excessive debug statements might also mean a developer could benefit from reading up on the capabilities of their debugger.
Geek points for nailing the movie line in the title. No Chris Fields you don’t count, that one’s too easy for you.
The point of a code smell is to recognize a problem so you can begin to move in a different direction. I’m not sure what you do with legacy code, but with new code the key in my opinion is a well factored solution for ease of understanding and strong unit testing. Excessive amounts of debugging often means your unit testing isn’t granular and comprehensive enough. Excessive debug statements might also mean a developer could benefit from reading up on the capabilities of their debugger.
Geek points for nailing the movie line in the title. No Chris Fields you don’t count, that one’s too easy for you.
The original post with comments is at http://jeremydmiller.blogspot.com/2005/06/what-amazing-code-smell-youve.html. I think it took about 15 minutes for someone to give me the movie title.