Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!eecae!netnews.upenn.edu!rutgers!cmcl2!adm!xadmx!Kemp@dockmaster.arpa From: Kemp@dockmaster.arpa Newsgroups: comp.unix.wizards Subject: Re: structured programming Message-ID: <18540@adm.BRL.MIL> Date: 5 Mar 89 17:07:25 GMT Sender: news@adm.BRL.MIL Lines: 32 > From: John Chambers > Most languages' standards/specs/whatever allow the compiler writer to > handle the null case in a way that makes the non-null case the fastest; > C compiler writers aren't allowed such trickiness. It's a real help to > know that the code will loop just as many times as I tell it, no more, > and no less. It's also a big help to know that the "control variable(s)" > are guaranteed to keep their final value, and that the compiler can't > play efficiency games that work differently on different systems. I > like the idea of a program that does exactly what I say, even (especially) > when there's a "better" way. The fortran-77 standard doesn't allow "trickiness" that affects the number of times a loop will be executed based on the whims of the compiler writer. The exit condition is checked at the beginning of the loop to allow zero or more executions; and the control variable is guaranteed to retain it's current value (if you break out of the loop) or the value that caused the test to fail (if the loop terminates normally). What could be more deterministic or explicit? (Of course fortran-66 one-trip loops were a botch, but 1966 was a LONG time ago). Disclaimer: I write mostly in C, I only use fortran for signal processing. Honest. --------------------- btw, what is the address for submissions to the unix-wizards digest? I believe that if this is sent to unix-wizards@sem.brl.mil, it will go out as its own little message. Dave Kemp