| ??? 09/18/06 21:41 Modified: 09/18/06 21:43 Read: times |
#124518 - a rebuttal Responding to: ???'s previous message |
Modular programming is great, and I consider it mandatory practice. That, however has NOTHING to do with global variables.
Russ, you are evidently a member of the "global variables are evil" society. This mantra has about the same value as "C is self-documenting" In your example above, why slow everything down just to have a "get a character from input" because "global variables are evil". It is much more effective to direct the data to where you need it. Local variables are wonderful IF they are truly local. Restructuring everything just to keep some variables local is sheer folly. I know the speedkiller of function calls with 17 parametres is supposed to be 'elegant' and 'true C' Bullshit!. Of course since "C is self-documenting" your variable names are probably i, j and k which, indeed does make global variables dangerous. However the risk of having a variable such as GBiicInputReady misused is ZERO unless a complete idiot is thinking it is 'useable' for something else. The "global variables are evil" MAY have a place in PC programming, but the '51 ain't no PC Erik |



