Tag Archives: comments

#10 Indicate what happens when function can’t return value

There are many functions which take a value, go and look for something, and return an object. If the object is found it is returned, but if it is not found, what do you do?  There are two possibilities, either return a null, or throw an exception.  Often, there is justification for having two methods: one that returns a null, and one that throws an exception.  But how do you tell them apart?  This post suggests a possible naming convention. Read the rest of this entry »

Leave a comment

Posted by on October 10, 2011 in Coding


Tags: , , ,

#1 Don’t make content-free comments

Avoid the inclusion of “content-free java-doc”. This means that a Java-Doc header is created that has no information content in there. Comments in general should have useful information that is not obvious, or there should be no comment at all. Read the rest of this entry »

Leave a comment

Posted by on September 29, 2011 in Coding