Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!hplabs!hp-pcd!hplsla!jima From: jima@hplsla.HP.COM (Jim Adcock) Newsgroups: comp.lang.c++ Subject: Re: variable declaration Message-ID: <6590252@hplsla.HP.COM> Date: 18 Sep 89 17:24:38 GMT References: <953@ncratl.Atlanta.NCR.COM> Organization: HP Lake Stevens, WA Lines: 15 > >There shouldn't be any issue of optimization no matter where one declares > >one's variables using any modern optimizing compiler. > > Be careful when making statements like this! ;-) If you are talking about > strictly automatics (locals), this is true, but not if you are comparing > automatics and external (global) variables. Automatics can be much more > easily and effectively optimized than externals; witness the code generated > by the GNU C/C++ compiler. > > kurt Sorry, I assumed that since globals are typically bad programming practice, and typically less efficient than automatics, that people would not *think* I was referring to them. Don't use globals unless forced to -- and with static class members, why would you be forced to?