Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Re: Re: <rant>CPAN modules failing to check for write errors</rant>

by jepri (Parson)
on May 30, 2004 at 10:52 UTC ( [id://357587]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: <rant>CPAN modules failing to check for write errors</rant>
in thread <rant>CPAN modules failing to check for write errors</rant>

And this is exactly why I don't like exceptions. Rather than handling errors within the module, the code just sproings them up to the next level.

Except then everyone has to check all their code all the time for exceptions. If one person doesn't, then a trivial error rips it's way up the call stack until it is caught by a piece of code that may not even be aware of the sub-sub-sub-modules existance.

Just like threading, some people immediately try to do everything through exceptions even when it isn't necessary. I rather see people writing decent code that tries to recover and do the right thing.

If that's going to be the standard answer in Perl6, then I can see I'll be in for a lot of debate.

____________________
Jeremy
I didn't believe in evil until I dated it.

  • Comment on Re: Re: Re: <rant>CPAN modules failing to check for write errors</rant>

Replies are listed 'Best First'.
Re: Re: Re: Re: <rant>CPAN modules failing to check for write errors</rant>
by Anonymous Monk on May 30, 2004 at 16:12 UTC
    I rather see people writing decent code that tries to recover and do the right thing.
    True - but when you don't know who's going to use your module, and in what ways, it may be difficult to know what the right thing is, but that's a fair point.

    Personally I do mix exceptions and return values depending on the module and script (not quite as chaotic as it sounds :) - I've certainly found that a fairly judicial use of exceptions can clean code up no end, and the less code I write, the less chance for error.

    I've built a few larger applications/modules around Exception::Class, and I'd hate to try to re-implement them checking every return value, but as I said in an earlier post, I always found exceptions in Java a pain in the **** for the reasons you've stated.

    As for P6 - who knows? Every time I read (or try to read) an appocalypse I feel worried, but then Damian usually manages to make it all sound ok. The only thing I've seen so far that sounds terrible is whitespace determining how a method is called - P6 should definitely absorb some of Pythons better features, but I'd prefer it if they left whitespace the hell alone :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://357587]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-24 01:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found