Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I think anyone who does anything with programming and/or systems administration can feel your pain. I've inherited tons of code from previous admins, varying shell/c/vb/vc++, etc and it's been a riot trying to figure out what's going on.

I believe they fall in several categories and for each one, I've figured out a method that keeps my sanity.

1: Unorganized Q&D - quick and dirty, we've all seen those. No comments, sloppy code, chaotic design, definitely needs being rewritten as soon as possible. Filed away for later perusal.

2: Organized Q&D - at least an attempt to have a cleaner code of the previous statement, some comments, however brief, spaced/indented code in most areas. Some sections might need work but overall, functional and not necessarily needing rewriting.

3: Organized code in development - development code/scripting that looks good but may have design structures that are different than yours and since understanding what every line does, a possible rewrite using existing code but substituting your function/variable names can be done. Also might rewrite just for brevity/improvement/efficiency/etc but not needed due to development. This is common of the "if it ain't broke, don't fix it" clause.

4: Unorganized Q&D in production - same as point 1, but in production and is desparately in need of an immediate rewrite, however on-the-fly that may be. Bug fix to keep going, but filed immediately for cleaner/improved code.

5: Semi-organized lengthy inherited code in production - hardest kind to maintain. Production states that it's been added on and maintained for the duration by several groups/people and is good in some areas and possibly horrid in others. Possible rewrites through CVS/SourceSafe/etc are worthy, but only if the entire thing is done, otherwise it's just bug-fix and move on.

IMHO, I try to rewrite everything that isn't well-documented. I learned rather quick that as long as I know the function of the script/code, I can probably rewrite it faster than trying to figure out what variable $xn2 does. That's the beauty of the call-sign of perl - "There's always another way to do it". That applies to everything in code, production and development alike. And fortunately, my sanity's been able to be kept although there are times when I really want to scream 'WTF is this?' when looking at some obscure non-documented code buried in the archives of legacy programs.

In reply to Re: Difficult code (Resolutions) by Vorlin
in thread Difficult code (Resolutions) by xChauncey

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-04-24 12:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found