On Tue, Oct 08, 2002 at 05:03:26PM -0400, Trey Harris wrote:
> > It really ought to be one of those "sure you can do this, but please don't"
> > things.
> 
> It's a RuntimeException.  You can't require that all RuntimeExceptions be
> declared if thrown;
<snip>
> You can subclass RuntimeException.  So if Sun hadn't provided an
> UnsupportedOperationException, anyone else could easily have done so.

I'm not objecting to the fact that it's a runtime exception [1] or that it's
possible to do such a thing.  I'm objecting to the fact that it's an
exception at all since it adds uncertainty into what should otherwise be a
guaranteed interface and that this uncertainty is put in the core library of
the language.

Because Sun did it it's now Officially OK, even if that's not what they
ment.  More so in the Java world than in Perl, things you do in the core API
become canonized. "Because that's how Sun does it" carries a lot of weight.
In Perl it's often "that's how (C|Bourne Shell|$popular_module) does it".

Programmers parroting the design of a popular API is common and can be used
for Good or Evil.


[1] It would be less worse [2] as a compile-time exception.
[2] This is different than "better". ;)

-- 

Michael G. Schwern   <[EMAIL PROTECTED]>    http://www.pobox.com/~schwern/
Perl Quality Assurance      <[EMAIL PROTECTED]>         Kwalitee Is Job One
I don't get it.  Must be art.

Reply via email to