Question on getopt()

Ben Cranston zben at umd5
Fri Aug 15 04:10:18 AEST 1986


Sez: guy at sun.uucp (Guy Harris)
> Anybody with source has certainly learned by now that the UNIX documentation
> is only a rough approximation to the truth.  The source code is, in some
> cases, the final arbiter; in others, the documentation is correct...

Sez: bzs at bu-cs.BU.EDU (Barry Shein)
> No, no, the COMPUTER is the final arbiter. When in doubt make up a few
> little code samples and see what they do. This doesn't require
> sources, except your own and works well, I'm serious. It never ceases
> to astound me how many times people come in to my office and ask me a
> question that is amply answered with "go ask the computer, why bother
> me, I can't simulate a computer as fast as it can simulate itself..."

While I agree generally, there are sometimes questions dealing with writing
transportable code that should definitely *NOT* be determined by the use of
trivial test programs.  A code fragment like:

      a[i] = b[i++];

for example is likely to do different things on different machines, and
only an experienced human being can give you the answer you REALLY want:

"Yes, it does what you want on *THIS* machine, but *DON'T* use code like
this because it is not portable."

-- 
                    umd5.UUCP    <= {seismo!umcp-cs,ihnp4!rlgvax}!cvl!umd5!zben
Ben Cranston zben @ umd2.UMD.EDU    Kingdom of Merryland Sperrows 1100/92
                    umd2.BITNET     "via HASP with RSCS"



More information about the Comp.lang.c mailing list