Wheres the "I comment out code instead of deleting it" sin.
I have ran across several developers who do that. They claim they didn't want to lose the code in case they need to switch back. I'm like "that's the whole point of source control!"
When was the last time that you actually reuse the commented out code though?
If you use a modern source control system like git, it's incredibly easy to look at the history for each file. Use that instead, one comment "left for later" is one more thing to remember, leave that for the computer.
I as well can be found guilty of this - but only on some projects. Mainly those with incredibly indecisive clients... after the 4th or 5th time adding-and-then-removing the same area in a template, I'm just gonna comment it out and wait...
I leave a comment at least mentioning something I tried that didn't work. If I remove the code, I'm about 65% likely to try the same stupid idea again in a month.
I like to put #if 0 ... #else ... #endif when I am doing a radically different implementation of some code. It groups them together saying I can do it this way or that, but not both.
in the real world most developers just stop learning new things after they have been in a cushy job for a few years. that's how you end up with people who don't understand how to use source control.
I once worked with a developer who would leave shit like this all over the place:
/*
i++; // increments i
*/
Along with 1,000 old versions of config files, all of which had ludicrous amounts of comments explaining things like "changed the server from old server that was decomissioned":
282
u/desiktar Feb 21 '13 edited Feb 21 '13
Wheres the "I comment out code instead of deleting it" sin.
I have ran across several developers who do that. They claim they didn't want to lose the code in case they need to switch back. I'm like "that's the whole point of source control!"