P is for Practical | |
PerlMonks |
Re: code execution speed and variable name lengthby TomDLux (Vicar) |
on Aug 04, 2004 at 02:53 UTC ( [id://379882]=note: print w/replies, xml ) | Need Help?? |
When you invoke a Perl function or operator, you have a function call overhead. I would expect processing time for a 20 character key vs a 2 character key to be small relative to function call overhead. Meaningful names are good, but don't fall into the Java trap of thinking that a $Variable_with_a_very_long_name is neccesarily more communicative than "$colour". If you are using multi-layered structures with long-ish names, it can clarify your code if you use aliases, especially if you are doing several operations in one vicinity of the structure:
--
In Section
Seekers of Perl Wisdom
|
|