Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re^2: Request for comments - Proc::UID

by pjf (Curate)
on Jun 08, 2004 at 01:17 UTC ( #362174=note: print w/replies, xml ) Need Help??

in reply to Re: Request for comments - Proc::UID
in thread Request for comments - Proc::UID

Thank-you for the encouraging feedback. It's very much appreciated.

My view on exceptions versus return values is that they provide the same information, but with different default actions:

  • When communicating success or failure using a return value, the 'default action' is to ignore the failure.
  • When communicating success or failure using exceptions, the 'default action' is to abort the program.

We commonly convert between return values and exceptions, with eval {} and or die "..." being the most commonly seen transformations.

Given that any manipulation of privileges implies that work is being done in a security sensitive context, I feel that the only sensible course of action is to throw an exception should an operation fail. A program that wishes to handle such an event can easily catch the exception and do so.

The croaks in the XS code definitely need to be standardised to more easily allow for exception handling to occur, and it's my intention to have this done and the exceptions well documented before the module is released in a more stable form.

Many thanks again for the feedback,

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://362174]
[Discipulus]: uch; everytime i want to read some source code i finally choke against an XS..

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2016-12-05 10:38 GMT
Find Nodes?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:

    Results (79 votes). Check out past polls.