Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

My Manifesto of pointless exceptions checking

Name: Anonymous 2011-05-09 12:59

I'm tired of seeing in Internet this pattern:

try {
        /* sth */
} catch (Exception e) {
    System.out.println("error");
}


That's why I made bellow my manifesto:

Exceptions should be checked only if:
1. You can perform recovery action
2. From context you may print information, that may help to investigate problem

In other cases, they should not be checked, because You may not do anything useful in that situation.

Exception mechanism built in language should:
1. Show useful informations about occurred faults

Name: Anonymous 2011-05-09 13:42

>>1
Agreed OP. Unfortunately, Java with it's checked exceptions and exception specifications is largely equivalent to using try-catch blocks all over the play for redundant exception forwarding.

So part of your manifesto should be to not use Java.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List