home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / programm / 2432 < prev    next >
Encoding:
Internet Message Format  |  1992-08-22  |  1.6 KB

  1. Path: sparky!uunet!cs.utexas.edu!wupost!waikato.ac.nz!aukuni.ac.nz!ecmtwhk
  2. Newsgroups: comp.programming
  3. Subject: Re: ANSI C, was Re: Teaching the basics
  4. Message-ID: <1992Aug23.021756.21237@ccu1.aukuni.ac.nz>
  5. From: ecmtwhk@ccu1.aukuni.ac.nz (Thomas Koenig)
  6. Date: Sun, 23 Aug 1992 02:17:56 GMT
  7. References: <1992Aug22.113219.4821@prl.dec.com>
  8. Organization: University of Auckland, New Zealand.
  9. Lines: 25
  10.  
  11. boyd@prl.dec.com (Boyd Roberts) writes:
  12.  
  13. >Prototypes are cheap hack, and they can lie, whereas the actual
  14. >function declaration specifies it exactly.  The protypes just say that the
  15. >calls agree with the prototypes, and that's not the same as the actual
  16. >declaration.
  17.  
  18. >Putting extra info in the object would be a total win.  Why should I go to
  19. >declare my functions twice, when the machine can do that stuff for me?
  20.  
  21. Prototypes are at least better than nothing, if you enforce their use.
  22. ANSI-C really could not do much better without breaking all existing C
  23. program up to that date. If you have declared your header dependencies
  24. in your makefile correctly, you should not have any problem.
  25.  
  26. Actually, I like the Modula-2 concept much better: Put definitions
  27. (declarations, in C usage) into separate files and let the compiler barf
  28. if use or implementation (definition, in C usage) do not agree with
  29. these. Finally, let the linker check wether the compiled definition and
  30. implementation modules actually belong together. A pity Modula-2 does
  31. not have either decent or portable I/O libraries...
  32. -- 
  33. Thomas Koenig, ecmtwhk@ccu1.aukuni.ac.nz, ib09@rz.uni-karlsruhe.de
  34. The joy of engineering is to find a straight line on a double logarithmic
  35. diagram.
  36.