a marriage worth the earning for better for worse sitemap
2046 2004 dvdrip sitemap
2011 songbook cazuza almir chediak sitemap
20 06 gotas de sabedoria 2 mb mp3 sitemap
2011 almera responsive portfolio wordpress theme download sitemap
a beautiful accident explicit sitemap
26 best ever games for nokia sitemap
2011 pp checker sitemap
activate windows 8 sitemap
2011 last dance at the wrecker s ball robert douglas sitemap
14 year old blond preteen pussy sitemap
2011 land of the lost sitemap
about inprivate vdeos zoofolia hd sitemap
ac ryan firmware download sitemap
08 durazno y convencin 6 mb mp3 sitemap
2011 without a paddle sitemap
201 organic baby purees the freshest most wholesome food your baby can eat sitemap
2011 the neighbourhood honest lyrics sitemap
2011 introduction to electrodynamics griffiths fourth edition solutions sitemap
20 feet from stardom 2013 sitemap
a pdf restrictions remover keygen sitemap
action pack download my software sitemap
2011 without a paddle sitemap
able 2 extract full patch incl serial sitemap
a grammar of lango sitemap
3 ways to enjoy the kids choice awards online sitemap
absolument 70 les plus grands tubes franais sitemap
15 saudi download sitemap
7 into snowy sitemap
a murder of crows avi sitemap
a million ways to die in the west sitemap
2011 the grand budapest hotel sitemap
2011 seeds of rebellion beyonders sitemap
6 5 2 kannada 2013 sitemap
10musume 042514 02 hd part1 rar sitemap
2011 songbook cazuza almir chediak sitemap
2011 disneys mickey and the beanstalk full version download sitemap
accubeatmix mac free full full version download sitemap
2011 when everything changed gail collins pdf sitemap
aa big book free sitemap
aadtan rasmit nishaniya latest punjabi songs 2013 punjabi songs speed records sitemap
2011 cracklock for mac sitemap
50 cent smoke feat trey songz 2014 single sitemap
300 checked sitemap
101 questions and answers about hypertension sitemap
aasai video songs sitemap
a walk to remember 2002 sitemap
2011 happy feet dublat in romana sitemap
101 essential tips bonsai sitemap
2009 uniform plumbing code free zip sitemap
2011 piradinha sitemap
aci 301 free download sitemap
a point of balance the weight and measure of anglicanism sitemap
2011 codigo de activacion mackeeper gratis mac sitemap
2011 activate license icompta sitemap
absolute power 1997 sitemap
18 year old virgin 2009 dvdrip shitty sitemap
2kd ftv engine manual pdf sitemap
achmad albar zakia 4 mb mp3 sitemap
actor training sitemap
absolute beauty radiant skin and inner harmony through the ancient secrets of ayurveda sitemap
8 apellidos vascos espaol sitemap
acdsee 14 keygen sitemap
2011 pc remote controller license activation free sitemap
123 pdf converter crack sitemap
access 2007 product key sitemap
21st jump street sitemap
3 idiots 2009 download free mp3 songs sitemap
2011 cmdt 2012 free download sitemap
a complete history of my sexual failures flv sitemap
11 eu preciso dizer que te amo 4 mb mp3 sitemap
ab mailar 8 sitemap
07 pyaar do pyaar lo dj shivam rmx 4 mb mp3 sitemap
2whataboutyour download sitemap
2 cellos added by users sitemap
a death in white bear lake the true chronicle of an all american town sitemap
across the universe ita sitemap
accounting information systems 10th edition sitemap
a mothers love xxx dvdrip sitemap
3dreshaper free download full version download sitemap
abg smp wawan net new 2010 3gp sitemap
aashiqui 1990 indonesi sitemap
2 states sub title in englidh sitemap
a haunted house 2 2014 free torrents tested sitemap
41 sibilia la intimidad como espectculo pdf sitemap
1pondo 032713 558 sitemap
2011 dani collins 4shared com sitemap
ableton live 9 2 4 gratis sitemap
abby mcdonald sophomore switch sitemap
9yo suziq 06 fingers rar sitemap
04 acura tl manual pdf sitemap
actionbacks wedding overlays 02 sitemap
10musume 010414 01 saya hashimoto uncensored sitemap
a young korean woman miko sitemap
2011 two for the dough evanovich janet sitemap
13 anito porno erotico movil sitemap
2011 zapatlela marathi movie sitemap
accuweather for ipad sitemap
acrobat pro ita sitemap
3herosoft iphone to computer transfer 4 1 1 0 518 sitemap
Home > Development, Rants > Clean Code

Clean Code

November 21st, 2005 Leave a comment Go to comments

We who cut mere stones must always be envisioning cathedrals.
-Quarry worker’s creed

That quote comes straight out of one of my favorite books: The Pragmatic Programmer. Ever since I stumbled on this book four plus years ago I have been an evangelist for its teachings. I read the author’s blogs (PragDave, and Andy’s Blog) religiously and I keep hoping the Rails Studio will make a detour to the Midwest.

Anyway, one of my absolute favorite pearls of wisdom from Pragmatic is “Don’t Live with Broken Windows.” Basically, a car in a seedy part of town will be left untouched until a single window is broken – then it’ll be stripped in a matter of hours. For more on the theory, check out the Wikipedia entry: Fixing Broken Windows.

This theory was brought to my attention today in a code review. Not that the code was bad (though truthfully, I don’t know enough about the business yet to be able to do more than “that variable name isn’t very descriptive”) but it had some dead code in it. I’ll admit, there was a time (a brief while) when I didn’t mind having lines and lines of commented out code but not anymore. With version control (you do use version control right?) there just aren’t any good reasons to keep unused code around. All you’re doing is making the code harder to read – and most of us prefer writing code anyway! A simple thing, sure, but next time you’re editing some source and you run into a chunk of code that the compiler is ignoring do yourself and everyone else in your shop a favor and burry that code for good. You can always look back at the history in your version control…

Update: I knew there was something else that made me think of this topic recently. Check out Anatomy of Ugly: How Good Code Goes Bad. This is what happens when you read way too many blogs and newsletters (or so my wife says).

Categories: Development, Rants Tags:
  1. Joe
    November 27th, 2005 at 18:18 | #1

    I agree with you about dead code. If its not being used, you are just cluttering the program and making things more difficult. However, I have stumbled upon this several times in code that always makes me pause when i want to delete it. It almost always looks like this:

    //Here’s something that we should turn on later when xyz happens…

    Now I have no idea what this code is referring to any more. In my mind if this code should be functioning why isn’t it uncommented? However, how do I bring myself to delete something that obviously was meant to serve a purpose? No one is ever going to go back into source code control to retrieve something that they don’t even know exists. What do you think about this?

  2. November 28th, 2005 at 21:07 | #2

    I think you are talking about the prototypicall TODO comment. To me, it’s one thing to leave yourself some reminders but to comment out code that truly isn’t functioning anymore is just setting yourself up for pain. That said, I have to consider the YAGNI principle (http://xp.c2.com/YouArentGonnaNeedIt.html) – when you write a comment like that you might *think* you will need to turn this on, but how often have you actually done it? You hit it right on the head when you said “Now I have no idea what this code is referring to any more.” Exactly. You did when you wrote it…but that was two months (OK two days) ago. Frankly, I think clean code that is easily modified will provide greater benefit than you *might* get from a bread-crumb like that.

  1. No trackbacks yet.