Tuesday, September 11, 2007

Code Quality

Seriously, you need to think twice if your class has 2800 lines of code! And please don't comment your code with obvious sentences. Having no comment is a lot better than having a stupid comment.

 

Stupid comment example 1:

// Checks if total is greater than limit.
if (total > limit) {
doScrewThePerson();
}


Stupid comment example 2:


/**
* returns the favourite person
*/
public Person getFavouritePerson() {
return this.favouritePerson;
}