Think of variable names in a LZW compression style. The more you use it, the shorter it can get, but to a point. I was just saying that for things you use capital-A All The Time, you can get by with a single letter. For me, $r is Always the same thing. It's sacred.
If you want, you can call it $apr, or whatever, but things like $apache_request are kind of like naming your dog The Happy Canine Who Is My Life-Long Friend Named Spot. When you're talking about $dbh or $cgi, you should have an idea what you're dealing with.
What I don't like is functions like this:
sub mulch
{
my ($x, $z, $zz, $a) = @_;
$x->foo($z, $zz, $a->id());
$z->insert($x);
$a->restore();
return $x;
}
Isn't that informative? Without backtracing through caller after caller, you have no idea what type the variables are. Sure, you
could put in some diagnostic code, but isn't that kind of absurd?
All I'm saying is that if you use someting A Lot, you can reduce the letter count accordingly. If you use it almost never, you should be pretty clear as to what it is.
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.