This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: FW: Kawa and BSF


> > Throwing a checked exception is a contract between your code and an
> > end-users calling code that delimits exactly these
> circumstances where you
> > _know_ in advance something may go wrong.  Users are forced
> into this
> > contract at (javac) compile time, which is good and proper
> - they need to
> > acknowledge what can reasonably go wrong, and what they're
> going to do about
> > it (throws it on again, or catch it).
>
> This is a bit like the argument about staticly typed languages and
> dynamically typed languages. I have to agree with Per Bothner here
> on two levels. Firstly, Kawa is first and foremost Scheme, and
> Scheme is runtime typed. (If you love all this stuff about "contracts"
> why are you using Scheme? :-).

I'm here to make your Schemey lives miserable.  That's my game-plan.

> Secondly, I have to say that the Java
> model of checked exceptions is a brain dead idea. Every time you write
> an app you end up writing a class called MyAppException. Then every
> method in the Universe ends up throwing MyAppException. Eventually
> you say to hell with it and make MyAppException a RuntimeException.
> Another example is applications that do a lot of database
> manipulation.
> You end up that everything in the universe throws SQLException.
> Doesn't buy you anything.

The Java exception model is fine.  The C++ exception model; that's
brain-dead, if you're looking for something to pick on.  I don't know if you
speak for Per here, but you seem to be saying that you're not using Java
exceptions properly because you don't agree with them, or can't be bothered
with them.  Fair enough, but my point is still that this could actually make
things harder for Kawa's users as they have to worry about catching all
run-time exceptions and then worry what type they are.  Better to throw
nothing IMO.

They say learning Scheme makes you a better programmer so perhaps you've all
transcended and don't need any anal type-safe and checked mechanisms
anymore.  As it stands, Kawa reminds me of an old gem of a thrift shop,
whose rickety exterior belies the treasures freely available for those brave
enough to wander in.  Mild mannered and conservative Java programmers
meanwhile will take one look at the way you're bandying RuntimeExceptions
about, mewl, and run straight to the glitzy facades of JPython and NetRexx.
Their loss perhaps, but they might have bought something.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]