Author: Robert Hyatt
Date: 14:24:55 01/10/03
Go up one level in this thread
On January 10, 2003 at 15:51:55, Dieter Buerssner wrote: >On January 10, 2003 at 15:17:22, Robert Hyatt wrote: > > >>I understand that. But that assumes that (a) the function is defined in the >>_same_ >>file before it is used and (b) the function is defined _before_ it is used. I >>can show >>you a program where this is impossible to do, which means that explicit >>declarations >>for the functions have to either appear directly in the procedures that call >>them, or >>more commonly, in a header file everything includes... > >Sure. Note that Uri mentioned in this same thread: > >>All calls for the functions are done after the function and in the same file. > >I answered in this context. And also in the context that you wrote "you must >..." I agree with everything you said above - sure. > >Regards, >Dieter My point was that programming like that is dangerous. If you set file scope for a procedure (static) then the bug can't happen, but just because _today_ you call it after it is defined doesn't mean that tomorrow you might not call it from another file, where it hasn't been seen, and the "assumptions" made by the compiler might be bad... My "software engineering" background makes that an ugly idea...
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.