"If you've learnt to understand it, why do you assume others will be unable to?"

That was not the point. Where this got started, I said that !!$return is a bad idea. The statement essentially returns a flag (boolean) value. Some prior statement should have made to make the return value crystal clear and given it another name other than $return: like $all_accounts_valid or whatever fits the application.

So the first style point is that $return doesn't describe what it is. Yes it is a return value, but what kind of return value? One line of code before the return was needed in my opinion to turn this into a boolean return value.

If you don't agree that using a better name than $return is "easier to understand" and a better style, then things degenerate from there and I have no hope of convincing you otherwise. And yes this will require one statement before the return to make this clear. But..

return $all_data_valid; is better in my opinion than:
return !!$return; There is no need for this confusing !!$return.

This is not a point of whether !!$return can be understood, the point is that there are easier ways of expressing this idea so that it can be easily understood. A Perl return scalar doesn't have a type declaration like in C. Often that very last return line has a lot of contextual meaning. returning a flag like: $all_data_valid is just going to convey more information than !!$return.


In reply to Re^7: Anybody use !! by Marshall
in thread Anybody use !! by Anonymous Monk

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.