Re: Top Ten Errors Java Programmers Make



Eric Sosman wrote:
Additya wrote:
Hello friends , Here is a nice article which I have found while
surfing , it is about the ten common errors which may be made by any
Java Programmer while Programming. The article lists all those
mistakes and their solution.
http://www.ezdia.com/Top_Ten_Errors_Java_Programmers_make/Content.do?id=839


No comment about whether these are or are not truly the
"top ten," except to note that the article makes no mention
of any kind of quantitative survey.

However, the article looks awfully old and some of its
advice is out of date. For example, error #9 (mistyping a
method name -> failure to override) says that the only way to
catch the problem is to notice that your "overriding" method
doesn't actually get called. In modern Java you'd use an
@Override annotation, and the compiler would catch the error.
(Also, examples based on AWT are just a wee bit antiquated.)

Another defense against mistyping override method names is to not type
them. I use Eclipse's source generation to produce override skeletons,
including the annotation.

Several of the errors seem to me to be biased towards learning Java as a
second language after programming only in a language with case
insensitive identifiers and 1-based arrays.

Patricia
.