Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re^7: Style guide for error messages?

by rir (Vicar)
on Sep 26, 2005 at 21:39 UTC ( #495222=note: print w/replies, xml ) Need Help??

in reply to Re^6: Style guide for error messages?
in thread Style guide for error messages?

You mentioned gotos and returns. On this list should be the closer cousin: semaphore flags. Flags are worse than exceptions because they are advisory.

I want my file and line number captured.

That goes into the message.

I was not complaining nor was I trying to change your mind (or practices); even brilliant men can disagree.

I'd prefer to be uninformative to users, but detailed to developers.

With objects one can inform both appropriately.

if it comes to wanting to discriminate one exception, my first question is why you want to do that

An example: A fair sized body of code, being 7 or more calls deep, explores the environment of the program. The scope of the environment is expanded and now failure to access a few resources is no longer reason to exit, instead by expressing the problem at the new top level, a separate tree of code is able to substitute some of the new resources instead. So now we want to discriminate a few exceptions from the many. Capturing some data to present to the user may also be appropriate.

That your fingers are trained to type confess is a valid and compelling reason to practice as you do, but it gave me a laugh. I thought of some programmer trying to use that as a justification to his boss--what made that image really funny is that such idiocynratic issues can have a serious impact on productivity.

For the simple case, objects are worse than strings. If ... more complex, then objects are an obvious win.

I agree with your opinion as you summarize it.

Be well,

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://495222]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2017-05-28 03:59 GMT
Find Nodes?
    Voting Booth?