Los Techies : Blogs about software and anything tech!

Now that I use the Delete Key…


Some Quick Background

I have the longest tenure on our team, and it’s not that long; there was a bit of an exodus just prior to me joining. I was with a small contract team and none of us knew the code when we were thrown into the situation. Needless to say, since I’ve been there the longest, I have the most experience with the code. Source control management was handled by Visual Source Safe 6.0 and there was little documentation. Most of the documentation was in comments in the code, usually followed by code that was commented out. Without the confidence of tools to ensure that our production code was actually the code in VSS (no common build process or automation). We were afraid of our code.

Moving On

Since then, we’ve switched to Subversion, we have an automated test suite, and continuous integration. I no longer have a fear of deleting code that is commented out. We do a fairly good job of not letting this even get into the source code repository, but you’ll find it from time to time. Our code review process is getting better each day and test coverage continues to rise.

As the post reads, I use the delete key without fear now. Code that is committed has comments tied to the revision, it has been reviewed and has tests around it. There is no need for code to be commented out, it only confuses matters, I delete it when I see it, and it’s a good feeling to be able to do so. I don’t think we’re that mature of a team, since I still get excited about unit test numbers, but this is a really good step to be in, compared to where we used to be.

Even Better! (A Side Note)

Not only have I been more apt to delete code that is commented, I’m also more likely to delete entire methods, classes and interfaces. This is largely due to the fact that our entire team has a copy of ReSharper by JetBrains. Tools only get you so far, but they can be helpful in reducing the time it takes to get something done. ReSharper is great for refactoring enforcing some best practices like removing un-used code.

Kick It on DotNetKicks.com
Posted Jun 06 2009, 09:21 AM by Chris Missal

Comments

Tim Barcz wrote re: Now that I use the Delete Key…
on 06-06-2009 11:56 AM

Kind of liberating isn't it?  There's something highly satisfying about a clean codebase.  I don't know how people live with large blocks of commented out code or unused classes in their code.

What is harder yet to do is to delete some awesome piece of code because it is now obsolete...

Sanjeev Agarwal wrote Daily tech links for .net and related technologies - June 7, 2009
on 06-07-2009 5:15 AM

Daily tech links for .net and related technologies - June 7, 2009 Web Development Implementing Incremental

Hadi Hariri wrote re: Now that I use the Delete Key…
on 06-07-2009 6:34 AM

You would think it's obvious, but I still run into commented out code.

Add a Comment

(required)  
(optional)
(required)  
Remember Me?

Enter the numbers above:
Copyright Los Techies 2008, 2009. All rights reserved.
Powered by Community Server (Commercial Edition), by Telligent Systems