Beefy Boxes and Bandwidth Generously Provided by pair Networks kudra
Do you know where your variables are?
 
PerlMonks  

Re: Efficiency and length of variable names

by TedPride (Priest)
on Mar 12, 2005 at 18:32 UTC ( [id://439026]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Efficiency and length of variable names

In terms of memory and processing time, there's so little difference between $a and $a_variable_with_long_name that the time you've spent on this discussion is already greater than all the time you'll ever save if all your programs instantly rewrote to one-character variable names. However, there's a much bigger impact on typing time and code readability, and it's only this you should worry about. Variables should follow a standard naming system (regular variables all lowercase, constant variables all uppercase, underscores to separate words inside variable names - or whatever), there should be proper use of scope, and the actual length of each variable name depends entirely on your preferences. I prefer short variable names myself, whenever possible without compromising readability, and I rarely use a variable name longer than ten characters. I just dislike having my lines of code twice as long as they need to be.
  • Comment on Re: Efficiency and length of variable names

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://439026]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.