global vs local variables
Author |
Message |
person
|
Posted: Fri Oct 07, 2005 7:10 pm Post subject: global vs local variables |
|
|
y have both global and local variables??
y not make them all global? |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
wtd
|
Posted: Fri Oct 07, 2005 7:17 pm Post subject: (No subject) |
|
|
Aside from the many other reasons to use locals:
When you localize variables inside a function, you remove the need to peruse the entire source code to look for influences.
When you use local variables and parameters/arguments properly, pretty much everything you need to know is within the function definition. |
|
|
|
|
![](images/spacer.gif) |
|
|