The following software developers need a good swift kick in the balls:
- People who can’t let a boolean stand alone, and have to compare it to another boolean, as in
"if (isOffline() == true)
“. Why not be extra safe, and make that “if ((isOffline() == true) == true)
“? - People who don’t realize that after you’ve modified a value in a Map, you don’t need to re-add it back to the Map to have it take effect. “get” returns a pointer to the original object, not a clone of it.
- Eclipse (or maybe Visual Age) users who leave the code littered with comments that say “
* TODO To change the template for this generated file go to Window - Preferences - Java - Code Generation - Code and Comments"
orInsert method description
. Either configure the template, or turn off automatically generated comments. - Anybody who declares a method to throw “Exception”, and anybody who calls methods that have explicit lists of what they throw, but who surround it with a “catch (Throwable t)” block. I don’t care if all you’re going to do is print the stack trace and continue, there’s no excuse for that sort of laziness.
- Anybody who changes huge swathes of somebody else’s code without asking the original developer if there is a better way. Especially if it’s code I wrote just a few weeks ago.
- People who use ‘do {…} while(cond);” People who use “if (cond == true) do { … } while (cond == true);” need to be kicked repeatedly.
- The entire staff of my company’s China office.