Jeremy D. Miller -- The Shade Tree Developer

Sponsors

The Lounge

Wicked Cool Jobs

Syndication

News

Advertisement

Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
What an Amazing (Code) Smell You've Discovered
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 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.

Posted Wed, Jul 20 2005 6:19 PM by Jeremy D. Miller
Filed under:

[Advertisement]

Comments

Raymond Lewallen wrote re: What an Amazing (Code) Smell You've Discovered
on Wed, Jul 20 2005 12:21 PM
Code with lots of Debug.WriteLines probably have cyclomatic complexities into the 20s, and instead of recognizing the need to refactor so its easier to debug, they stink up the code.
Sahil Malik [MVP C#] wrote Trace Logging - is not bad !!!
on Wed, Jul 20 2005 9:28 PM
Jeremy Miller, the latest codebetter addition, blogged about an Amazing code smell - in which he basically...
Sahil Malik [MVP C#] wrote Trace Logging - is not bad !!!
on Wed, Jul 20 2005 9:30 PM
Jeremy Miller, the latest codebetter addition, blogged about an Amazing code smell - in which he basically...
Steve Hebert's Development Blog wrote (Amazing) Code Smell - GC.Collect()
on Thu, Jul 21 2005 7:42 AM
I was reading Jeremy Miller's post on Code Smells
and another classic .Net code smell occurred to me. ...
Steve Hebert's Development Blog wrote (Amazing) Code Smell - GC.Collect()
on Thu, Jul 21 2005 7:53 AM
I was reading Jeremy Miller's post on Code Smells
and another classic .Net code smell occurred to me. ...
Steve Hebert's Development Blog wrote (Amazing) Code Smell - GC.Collect()
on Thu, Jul 21 2005 8:10 AM
I was reading Jeremy Miller's post on Code Smells
and another classic .Net code smell occurred to me. ...
Jeremy D. Miller -- The Shade Tree Developer wrote My Programming Manifesto
on Mon, Oct 30 2006 10:49 PM

As some of you know, I started a new job this month as a consultant helping clients to adopt Agile practices.

Paul Holser wrote re: What an Amazing (Code) Smell You've Discovered
on Mon, Nov 20 2006 12:29 PM

Nice post.  "Ghostbusters" is the movie, IIRC?

Jeremy D. Miller wrote re: What an Amazing (Code) Smell You've Discovered
on Mon, Nov 20 2006 12:50 PM

Star Wars!  When they're trying to escape the Death Star detention area and they go down the trash shute

Paul Holser wrote re: What an Amazing (Code) Smell You've Discovered
on Fri, Jan 5 2007 12:44 PM

Aaargghh!  I hereby turn in my Official Geek Badge and Decoder Ring.  8^(

Julien Crawford wrote re: What an Amazing (Code) Smell You've Discovered
on Mon, May 21 2007 1:24 AM

I like the code-smell concept its a good one.

The reason you (and I) though Ghostbusters was because of Dan Acroids : "Quite, do you smell something?" comment.

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
Devlicio.us