New strategy for commented code
After looking over loads and loads of code, Ive come to the conclusion that commenting out dead code is often done incorrectly. Typically you will see something like this.
public void doSomething(String myString) {
//for(int i=0; i<10; i++) {
// callSomething();
//}
}
This is all wrong. First you never know when this was commented out. Secondly, its hard to tell who commented it out. The whole point of leaving this code is for documentation purposes right? This kind of documentation doesn't seem complete now does it? Im suggesting that the programmer insert his/her initials and the date that these lines of code were tagged defunct. Im not telling you anything new, am I? Didn't think so. Actually, the more that I think about it, that is a pretty crappy way to handle the situation!
Any true software professional would not do such a thing. Its ridiculous to leave such crud scattered in source code. If the project you are working on has no version control software, then download CVS. Not only is it free and easy to install, its one of the most widely used CM tools around. Virtually every open source project is managed using it. If you don't like CVS, pick any other version control tool that suits your fancy. By doing so, you give yourself the safety net of always being able to get back to where you were previously. Just about everyone understands this fundamental concept, so why does defunct code exist? Somebody somewhere must be getting paid by the size of source files, that is the only reasonable solution.
// If anyone has an explanation or other ideas, please drop me a line.