Each error message should be unique enough to uniquely identify the code which threw the error, and to permit that code to be found with a simple search for the error message itself.

Not necessarily. One of the most common error messages is about not being able to open a file. If I can't open a file, I don't care at all where in the code the error occurs, only two things are relevant: which files was tried to be opened, and why did it fail.

Furthermore, I think that one shouldn't bother the user with line numbers where problems occur. Line numbers are fine for debug messages, as debug messages are (mostly) for the developer. Error messages are for the user, and (s)he can give diddle twit where the error occurs. Take for instance your cell phone. If you dial a number, and you cannot connect, you expect the phone to show you the number it tried to connect to, and the reason the connection failed. You don't really care on which line of the code this error message is on.


In reply to Re: The Evolution of the Lowly Debug Statement by Anonymous Monk
in thread The Evolution of the Lowly Debug Statement by hesco

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.