Advertisement

Global vars

Started by May 31, 2001 03:35 PM
1 comment, last by the darkening 23 years, 8 months ago
I wonder how much global vars are "allowed" for programs. I always thought they are a symbol of bad programming knowledge.
Unfortunately there is no right answer to that. Some believe that globals should be avoided at all cost, as they are a sign of bad design and break code reusability. Others believe that globals are easier to code and allow for faster access to widely used variables.

Personally I avoid them at all costs. Any code that uses a global variable can no longer be reused without code changes (unless you always use the same global variables AND naming convention for every project ).


- Houdini

Edited by - Houdini on May 31, 2001 4:51:23 PM
- Houdini
Advertisement
I don''t worry much about reusability. I''d rather make the code fine tuned for the project I''m working on.

Ben
http://therabbithole.redback.inficad.com







This topic is closed to new replies.

Advertisement