Firstly, a huge thankyou to everyone who replied. I am somewhat overwhelmed by the volume of responses. It is very much appreciated.

After posting the OP yesterday, I replied to the first responses and then logged out. Logging back in today, I was presented with about a dozen direct replies; many of those had spawned their own little sub-threads. Much as I might like to reply to everyone, it really isn't practical; so, please take this as a general response to all. Another reason for a general reply is that I think I'd probably be repeating myself in many individual replies; this would tend to bloat the thread.

The extent to which people use labels varies quite a lot. Some use them always, which is in line with PBP; others use them to a greater of lesser degree depending on context, which aligns more with my usage; and, some either generally don't like them or have never found a need to use them. I expect, in general, I'll probably continue with my current usage; although, some replies were thought provoking and that may cause me to modify usage in certain situations.

Refactoring was mentioned in quite a few places and I agree with this. I inwardly groan whenever I encounter programs with monolithic tracts of code; these are hard to read, comprehend, maintain, extend and debug. I generally tend to have more _helper()-type functions than direct_interface()-type functions.

Another point raised was the depth of nesting and, again, I concur. Wherever possible, I generally try to avoid nesting at all; there are occasions when that's unavoidable, in which case I aim for shallower rather than deeper; if I've reached a fourth level, I've probably done something wrong and will rethink the solution.

A number of people spoke about PBP not being a set of rules that should be slavishly followed but rather a series of suggestions and recommendations to be adapted as appropriate. Definitely no argument from me on that one.

In conclusion, I asked for your thoughts and have received them in profusion. I won't be making any drastic changes to the way I work but I may modify some behaviours in a small way. Again, thank you very much.

— Ken


In reply to Re: Perl Best Practices - Loop Labels by kcott
in thread Perl Best Practices - Loop Labels by kcott

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.