Beefy Boxes and Bandwidth Generously Provided by pair Networks chromatic writing perl on a camel
XP is just a number
 
PerlMonks  

Re: What is maintainable perl code?

by grantm (Parson)
on Sep 20, 2002 at 06:19 UTC ( [id://199428]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to What is maintainable perl code?

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://199428]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.