quote:That really depends on the context and i have to point you that your example didnt have one
I know it didn''t. But that''s kind of the point. Interfaces are written
without any context. As such they must be appropriate whatever the situation they''re being used in. For a small console program (the kind of thing where the entire program fits on-screen) then perhaps an interface with checked exceptions makes sense. But that doesn''t mean it makes sense in a LOB system that''s running on a dozen headless servers 24/7.
With unchecked exceptions, it doesn''t matter -- I can catch the exceptions when it makes sense to, I can ignore them when it doesn''t. As such the interface is correct whatever the context. But checked exceptions force me to handle the exceptions even when it''s *not* appropriate.
quote:i really wonder where that tremendous statement comes from?
Wide experience.
quote:i rather have the opposite idea but hey! i check for errors instead of crash my application!
I''m quite happy for the application to crash if something''s happened that shouldn''t have.
quote:uh?
what''s the point? are you implying that this is a rather common situation? or you''re trying to tell me that since few times you have that you got crazy?
I''m telling you that the interface is over-specified, because it forces me to "handle" errors that cannot possibly occur.
quote:your attitude amazes me...
Because I don''t spend my time programming trying to second-guess the system and recover from errors? What''s amazing about that? It''s pragmatism, and it makes for more robust, less buggy code.
quote:ok so you just asume that there''s no file saving, no database transaction, nothing at all, right...
Where did you get that idea? I just said these things are taken care of by the stack unwind.
quote:another one... how comes that it violates encapsulation and since when you''re an oop purist?
exception gives you the information about possible unexpected events that you may have to deal with, it doesnt reveal how they are performed. that''s nonsenses
You don''t get it, do you?
If the situation is expected, I''m happy to handle the exception. If the situation is unexpected
I probably can''t.
And, yes, it does reveal how they''re performed. If I need to throw, say, an SQLException that says quite a lot about my implementation.
quote:Boyyyyyyy i don''t get your attitude, sorry that i cant help you to understand why the bigger players in the market took the decisions they did (i''m sure it wasnt because they want to make you unhappy, believe me...)
Exactly one player has taken that decision, and no-one has followed in their footsteps. Even the Java community itself isn''t particularly enthused by checked exceptions -- they''ve shown themselves empirically to reduce developer productivity but offer no practical benefits to offset this.