in reply to "advanced" Perl functions and maintainability

Some replies to your node have said something along the lines of "map/grep are not obscure, of course you should use them." I totally agree with that, for simple uses. Any novice perl programmer who comes across code that uses 'map' simply can easily look it up to figure out what it does. However, 2 things you said make me think your fears of maintainabily were well-founded:

1. You consider yourself one of the most advanced perl programmers at your company.
2. You needed to post a question to perlmonks to figure out how to write the code.

What I usually do when I've written something that took me a while to figure out, or that I think might take someone else a while to figure out, is to comment my intentions. That serves at least 2 purposes well: 1) someone skimming the code can look at this section and quickly understand what it's supposed to do, without having to understand the code. 2) if someone needs to debug my code, they at least know what I intended, and can be sure that I wasn't relying on some side-effect, or counting on some behavior for some special case.

Also, if I got help understanding it from some online source or some book, I'll include a link or a book name & page number in the comment to help others.

  • Comment on Re: "advanced" Perl functions and maintainability

Replies are listed 'Best First'.
Re^2: "advanced" Perl functions and maintainability
by geektron (Curate) on Dec 13, 2004 at 16:43 UTC
    i guess the points needs clarification:

    1. You consider yourself one of the most advanced perl programmers at your company.
    at the moment, i'm actually the *only* programmer at the company, perl or otherwise. (i admit i still have a bias that says HTML via Dreamweaver isn't programming). it's a small company ... 3 people.

    2. You needed to post a question to perlmonks to figure out how to write the code.
    i'll give you that one, but the only way i can get another pair of eyes on *anything* at this point is to post. more of a logistics problem than anything else. plus, by posting, i got a better solution than what i was banging my head on ....

    although, if i'm banging my head on it, chances are others would too ... but i do hope people can learn from my (publically viewable) mistakes ....

      Howdy!

      ...well, HTML is coding, but it ain't programming...so I ratify your bias

      yours,
      Michael