I have to say that I am slightly outraged by the tone, which implies that such behavior in error handling is something fundamental for Java programmers. Of course, Java programmers can be lazy like any other programmer, and Java is a popular language, so you are likely to see a lot of mistakes when swallowing code.
In addition, as indicated elsewhere, there are understandable frustrations with forcing Java to declare checked exceptions, although personally I have no problem with this.
I have a problem with, I think, that you are a breeze through a bunch of articles and code snippets on the Internet, without bothering to consider the context. In truth, when you write a technical article trying to explain how a particular API works, or how to start with something, then you are likely to miss some aspects of the code - error handling, which is not directly related to what you demonstrate is a likely candidate for deletion, especially if an exception is unlikely to happen in the sample script.
People who write articles of this nature should maintain a reasonable signal-to-noise ratio, and fairly, I think, this means that they should assume that you know some of the basics of the language in which you are developing; how to deal with errors and a bunch of other things. If you come across any article and notice the lack of proper error checking, then this is fine; just make sure that when you incorporate these ideas (but, of course, you are never the exact code, are you?) in your production code, you will be dealing with all these bits and beans that the author reasonably missed, thus that most are suitable for what you design.
I have a problem with very high-level introductory articles that do such problems without even returning to them, but please keep in mind that there is no specific “thinking” for Java programmers regarding error handling; I know a lot of your favorite C # programmers who are also not worried about all their problems.
Rob May 28 '09 at 23:59 2009-05-28 23:59
source share