in reply to Re: CGI Tables
in thread CGI Tables
Uh! Bad advice (the "shorten your variable names", not the map example)! Sorry, just my humble opinion.
As soon as the scope of the variable you use is larger than 5 lines, use Identifiers::Long! ;)
Then, if it's just 5 lines, you'll survive typing a long name two or three times either. When someone else will need to read your code -- and after 6 Months you yourself are someone else -- he'll be glad to have meaningful names.
I banned $i for counters right after school (where the formula's my programs were based on used i, of course), and I never missed it. Even if it's an iteration I'd rather use $iteration_count. And in case of indices it's nice to expess what your're indexing.
And let's be honest, typing $request especially in a coding situation takes me no longer that typing $r. Well almost... It surely takes more time to read (and lookup/translate and undestand) $r for anyone not knowing the obvious...
If I don't want to repeatedly type an identifier with a fancy name I simply cut and paste. Of course, it's good to know how to do that using your keyboard... ;)
There's enough abbreviation in Perl anyway ($_, $a, $b, $#array, etc.).
So, while I'm with you that obfuscuated perl is cool and fun, yet for serious work it's cool to use @long_names, and lame to be $lzy.
So long,
Flexx
PS: I know I am a style phanatic.
Update: Humm... I just realized I talked back to a saint... :] (...) a lazy saint. ;)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Long identifiers are fine (Re^2: CGI Tables)
by tadman (Prior) on Sep 02, 2002 at 13:42 UTC | |
by Flexx (Pilgrim) on Sep 02, 2002 at 15:18 UTC |