August 2004
Intermediate to advanced
480 pages
9h 41m
English
This is a list of things that are a good idea to do when writing code in the real world (he writes, as if there is any other world). I don't know if they are the best practices ever. That's pretty hard to determine concretely.
Do not squash exceptions—do something useful with them. It is common to see code that catches an exception, and then does nothing. The following will compile:
...catch(Exception e) {}.
Usually it isn't quite that angry, and you see a call to System.out.println(). If your application is a console application, this might be appropriate, but would it be better to save that message to a log file along with a timestamp, class name, and username? You bet. If you are writing a desktop ...
Read now
Unlock full access