Your claim of having a "faulty" memory suggests you think that 'better' programmers have memorized all the rules.

What my claim suggests is that I'm an old geezer. You are reading too much into my semi-serious comment -- I should have put some smileys in there. :-)

Really, I've been programming for about 30 years now, over 20 in C, and in the early days IIRC C compilers weren't quite standardized on precedence. Even in modern times and in perl, I found out the hard way (as the original OP of this thread) that precedence works the way you think it should 99% of the time, but there are times when it will bite you. Those times are almost not worth risking since they can be very subtle to debug -- and you feel like a total idiot when you find your mistake. FWIW, In reality I use as few parens as I can get away with and not start worrying.

Trust Larry more! Use parens less!

I do, trust me -- I don't whip them out like a crazed lisp programmer. A few more parens isn't going to cause a meltdown.


In reply to Re^3: not 'another victim of precedence' ? 'It is true' : 'the code is false' by bluto
in thread not 'another victim of precedence' ? 'It is true' : 'the code is false' by bobf

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.