Checked exceptions [Re: Hijacking]

Bill Baxter dnewsgroup at billbaxter.com
Tue Aug 7 18:34:56 PDT 2007


Nick Sabalausky wrote:
> "Rioshin an'Harthen" <rharth75 at hotmail.com> wrote in message 
> news:f974u9$9k1$1 at digitalmars.com...
>> "Walter Bright" <newshound1 at digitalmars.com> kirjoitti viestissä 
>> news:f95leh$hn4$1 at digitalmars.com...
>>> It might be one of those things like exception specifications where 
>>> everyone says it's a good idea but guiltily hate in secret <g>.
>> Exception specification *is* a good idea. Although I do hate it - try to 
>> remember what a specific method may throw when you write your code, 
>> especially if the error is ambiguous like "Unhandled exception" it's 
>> really irritating - but I hate unspecified exceptions even more, as the 
>> problem then is to even remember to put in the necessary try-catch-finally 
>> blocks.
> 
> Not to start a big big debate on it, but my own personal feeling on that 
> (after having used a fair amount of it) is that the specification of 
> exceptions belongs in generated documentation (whether javadoc-style or as 
> part of the IDE as with "some_function() -> Called By..."). I normally 
> prefer having to explicity specify things (yea, strong-typing fan here ;) ), 
> but personally, I find it overkill in this case. (Not to mention it gave me 
> flashbacks of writing C/C++ headers. j/k ;) ). 

I agree with this 100%.  With check exceptions it just becomes too 
annoying and verbose.  Without them, often it is too difficult to find 
out what exceptions are possible for a function to throw.

So the right place seems to be an analysis / doc-generation tool / IDE.

--bb



More information about the Digitalmars-d mailing list