one thing i do strive for in my code, as most "good" coders should, is maintainability. we all know that sometimes (and sometimes more often than we've planned), the quick-and-dirty hacks are the ones that end up lasting ... because the job they were meant for has never gone away.
in map and grep syntax question, i was trying to get a combination of map and grep working to set a selected element to pass to HTML::Template without using a foreach loop. one response Re: map and grep syntax question said that perhaps that combination wasn't as clear as a foreach loop ...
so i've been thinking about this, and while any Perl programmer can look at a
foreach loop and know what's going on, does that really mean that the use of
map in building a hashref isn't clear?
i realize there's no substitute for experience in deciding when a particular language construct or idiom should be used. if someone less experienced does end up with my code next year and has to fix something, and i've written good code (an assumption i like to make ... even though the code can always be better), is there a genuine problem with using a more "advanced" built-in, one that it sure seems the function was designed to do in the first place?
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.