Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^7: Style guide for error messages?

by rir (Vicar)
on Sep 26, 2005 at 21:39 UTC ( [id://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,
rir

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2024-04-19 23:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found