An Ethics Question

steve emmerson steve at umigw.MIAMI.EDU
Fri Apr 7 23:41:49 AEST 1989


I differentiate "global" variables into two types: "external" and "static".
Just like their namesakes, external global variables are visible outside
the compilation unit (file) in which they're defined whereas static
global variables (an oxymoron? ;-) can be easily referenced only from within 
the compilation unit.

I use external global variables *very* rarely.  I sometimes use static
global variables, rather than argument passing, from within a compilation
unit, even when strictly unnecessary.  If the unit is small enough, the
conceptual problems are small: about the same as the speed gain.  It's
a toss-up.
-- 
Steve Emmerson                     Inet: steve at umigw.miami.edu [128.116.10.1]
SPAN: miami::emmerson (host 3074::)      emmerson%miami.span at star.stanford.edu
UUCP: ...!ncar!umigw!steve               emmerson%miami.span at vlsi.jpl.nasa.gov
"Computers are like God in the Old Testament: lots of rules and no mercy"



More information about the Comp.lang.c mailing list