Whereas in .NET you heavily rely on documentation (which is often very incomplete) to know what exceptions could occur (granted, you could use some reflection tool for this), in Java, you instantly know because you can't compile until you handle them in some way, or re-throw them.
Monday, May 28, 2007
Exception handling in .NET
I've been working in Java the last few weeks, and now I'm starting to remember what I like about that language (I never forgot what I hate about it ). I like the way exception handling is done in Java, particularly the fact that the compiler forces you to handle or re-throw all possible exceptions.
Whereas in .NET you heavily rely on documentation (which is often very incomplete) to know what exceptions could occur (granted, you could use some reflection tool for this), in Java, you instantly know because you can't compile until you handle them in some way, or re-throw them.
Whereas in .NET you heavily rely on documentation (which is often very incomplete) to know what exceptions could occur (granted, you could use some reflection tool for this), in Java, you instantly know because you can't compile until you handle them in some way, or re-throw them.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment