Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
I read through all the responses here, and it seems to me that a couple comments would suffice to reduce confusion on what this block does. Yes, being small makes the example easier to read, but if the real world example is as complicated as you make it out to be, then the condition won't be in view while you are editing it anyway. Now, my question is, why would you even think of re-evaluating the condition over and over again when a
# begin infinite loop
{
  ...
} #end infinite loop
would suffice? Programmers tend to go on and on about how code should be self explanitory and not need comments, but why not toss in a comment and let the darned thing go without a condition? Honestly, when you comment code, it should clear up any questions that might arise, although I believe that this type of thing is not actually confusing, merely it seems to be unfamiliar. I remember the first time I sat down at a terminal and read a B.A.S.I.C. program. Even though it was english-like, it was in no way readable. Then I read another, and a few more, and suddenly GOSUB was not a weird word that some cryptic programmer placed there to confuse me, but a very useful tool. I don't even want to get into the first time I came across a "standard replacement" for the lack of a case statement in perl {scary}. My point is, things that are unfamiliar are not necessarily bad. There are many people who scorn the use of unfamiliar practices, but those tend to be "Seat-Filler", and either refuse to learn new and smoother ways or can't learn at all.

In the interest of having a style, a few comments placed can be a very satisfactory clarifyer to bring coders with different experience {not more OR less} to the same page as you. As for the actual question about it being "acceptable style", the best person(s) to answer that is your Manager or Peer Review Board. If you don't have those, you may be doing this for yourself, or the code is commented well enough to allow for your personal style {borrowed from merlyn or not} to shine brightly. Go forth and code either way.

Lord Wrath

In reply to Re: do/redo or for(;;): what's Kosher? by Lord Wrath
in thread do/redo or for(;;): what's Kosher? by rje

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!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others perusing the Monastery: (5)
    As of 2014-09-18 22:42 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      How do you remember the number of days in each month?











      Results (126 votes), past polls