Let's attack this from the opposite angle: What makes unmaintainable Perl code?

Passing stuff around using global variables - it makes it much harder to find why a value changed than if you pass/return values explicitly or use OO/accessor methods

Using Perl's builtin globals ($_, $/ etc) without using local()

Using the flip flop operator ('..') especially in close proximity to the range operator ('..')

Rolling your own solutions instead of using well tested CPAN modules with widely understood APIs

Not catching and handling errors, but leaving them to fall through to someone else's error handler

Using stupid symbolic reference tricks when you really ought to use a hash (see MJD's 3 part anecdote if only for entertainment value)

ASP spaghetti - chunks of code and conditionals and loops tucked away in gigabytes of <font> tags

Coding while drunk :-)

And here's a contentious one ... excessive use of inheritance. One advantage of 'uses a' (container style) over 'is a' (inheritance) relationships is that can be much easier to work out which class file to look in to find the implementation of a method.


In reply to Re: What is maintainable perl code? by grantm
in thread What is maintainable perl code? by disciple

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.