Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!ncar!umigw!steve From: steve@umigw.MIAMI.EDU (steve emmerson) Newsgroups: comp.lang.c Subject: Re: An Ethics Question Summary: which kind? Keywords: global variables Message-ID: <227@umigw.MIAMI.EDU> Date: 7 Apr 89 13:41:49 GMT References: <1819@uop.edu> Reply-To: steve@umigw.miami.edu.UUCP (steve emmerson) Distribution: na Organization: University of Miami Lines: 16 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@umigw.miami.edu [128.116.10.1] SPAN: miami::emmerson (host 3074::) emmerson%miami.span@star.stanford.edu UUCP: ...!ncar!umigw!steve emmerson%miami.span@vlsi.jpl.nasa.gov "Computers are like God in the Old Testament: lots of rules and no mercy"