observability

P E Smee exspes at gdr.bath.ac.uk
Mon Sep 11 19:24:35 AEST 1989


In article <10321 at csli.Stanford.EDU> poser at csli.stanford.edu (Bill Poser) writes:
>In article <1989Sep8.091010.12450 at gdt.bath.ac.uk> exspes at gdr.bath.ac.uk (P E Smee) writes:
>>one might ask why you would want to write a chunk
>>of code that has ZERO effect.
>
>I sometimes do this during program development. I declare the data
>structures and write the code that operates on them, leaving the i/o
>to worry about later. I may want to compile at this point to check
>for errors in the code.

Well, maybe.  Still, in that case you shouldn't be using an optimizing
pass of the compiler yet, and I at least would claim that a non-optimizing
compiler *shouldn't* go rearranging the code in any significant manner.
(And, I would also assert that a compiler *shouldn't* go throwing away
blocks of code simply because they don't do anything, without warning you
it's doing so -- again on grounds that people don't usually intend their
code to do nothing.)

Alternatively, take that as (yet another) reason for using C rather than
FORTRAN.

-- 
 Paul Smee               |    JANET: Smee at uk.ac.bristol
 Computer Centre         |   BITNET: Smee%uk.ac.bristol at ukacrl.bitnet
 University of Bristol   | Internet: Smee%uk.ac.bristol at nsfnet-relay.ac.uk
 (Phone: +44 272 303132) |     UUCP: ...!mcvax!ukc!gdr.bath.ac.uk!exspes



More information about the Comp.std.c mailing list