Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!novavax!twwells!bill From: bill@twwells.com (T. William Wells) Newsgroups: comp.lang.c Subject: Re: Uninitialized externals and statics. Message-ID: <1989Aug26.192845.15395@twwells.com> Date: 26 Aug 89 19:28:45 GMT References: <2128@infmx.UUCP> <10764@smoke.BRL.MIL> <478.nlhp3@oracle.nl> <1989Aug19.053711.7462@twwells.com> <1423@csv.viccol.edu.au> <984@m3.mfci.UUCP> Organization: None, Ft. Lauderdale, FL Lines: 34 In article <984@m3.mfci.UUCP> karzes@mfci.UUCP (Tom Karzes) writes: : In article <1423@csv.viccol.edu.au> timcc@csv.viccol.edu.au (Tim Cook) writes: : >In article <1989Aug19.053711.7462@twwells.com>, bill@twwells.com (T. William Wells) writes: : >> At one point, we got toasted by some of our customers because our : >> executables were excessively large. It seems that one of our : >> programmers did things like: : >> : >> int Array[1000] = {0}; : > : >Let's not misappropriate blame here. It seems to me that your compiler : >should take the blame in this scenario. Your programmer is simply making : >sure of what will be in "Array" when the program starts (sounds like a : >worthwhile programming practice). : : Actually, given that the programmer is unwilling to rely on implicit : zero initialization of statics, he/she is is only making sure that that : the first element of the array is initialized to 0 in this example. Actually, the programmer was just following someone's brain-damaged advice to initialize all globals. He had no idea why one might want to do so. No, he wasn't a very good programmer. Or even a good coder. Which reminds me of an answer to the "What makes a C expert" question that I was going to give but didn't get around to. The "competent C programmer" knows *what* is valid C. The "C expert" knows *why* it is valid C; moreover, he is capable of selecting the best C tool for the job, as opposed to merely using the first thing that comes to mind. Fundamentally, the difference is that of between knowledge and judgement. --- Bill { uunet | novavax | ankh | sunvice } !twwells!bill bill@twwells.com