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

  1. Path: sparky!uunet!cs.utexas.edu!asuvax!ncar!noao!amethyst!organpipe.uug.arizona.edu!news
  2. From: dave@cs.arizona.edu (Dave Schaumann)
  3. Newsgroups: comp.programming
  4. Subject: Re: Teaching the basics
  5. Message-ID: <1992Aug21.023919.27420@organpipe.uug.arizona.edu>
  6. Date: 21 Aug 92 02:39:19 GMT
  7. References: <Bt6DGq.HuB@metropolis.com> <12635@anderson> <ratner.714247759@ficus.cs.ucla.edu> <13226@bnr-rsc.UUCP> <MHCOFFIN.92Aug20162507@tolstoy.uwaterloo.ca>
  8. Sender: news@organpipe.uug.arizona.edu
  9. Reply-To: dave@cs.arizona.edu (Dave Schaumann)
  10. Organization: University of Arizona
  11. Lines: 38
  12. In-Reply-To: mhcoffin@tolstoy.uwaterloo.ca (Michael Coffin)
  13.  
  14. In article <MHCOFFIN.92Aug20162507@tolstoy.uwaterloo.ca>, mhcoffin@tolstoy (Michael Coffin) writes:
  15. >In article <13226@bnr-rsc.UUCP> sdms@bnr.ca (Andrew Sterian) writes:
  16. >> Hmmmm...I disagree on this one. It may have been true some years ago that 
  17. >> the type checking etc. of Pascal made it easier on novice programmers but
  18. >> the latest ANSI C compilers do just as good a job of it as Pascal.
  19. >
  20. >I've heard this said with quite a bit of frequency lately, but it
  21. >isn't true.  C compilers---even ANSI ones---don't do type
  22. >checking across separately compiled files.  If I put the function
  23. >prototype
  24. >
  25. >        int f(double);
  26. >
  27. >in one file and call f(3.14), the compiler is happy.  If I
  28. >then put the function
  29. >
  30. >        int f(int, char *) {... }
  31. >
  32. >in another file, the compiler won't complain about that either.
  33.  
  34. Note that this is a problem only if you are careless enough not to
  35. put the prototype for f() in a single .h file which is then included
  36. in all your sources which call f().
  37.  
  38. >The problem is, there isn't any enforcement of this policy.
  39.  
  40. *sigh*.  What do you want a compiler to do -- generate an executable, or
  41. be an AI conscience on how you should've written your code?  Sure, having
  42. automated checks for consistency and reasonableness are worthwhile, but
  43. there's a point where the programmer has to take responsibility for his
  44. product.
  45.  
  46. Power requires responsibility; always has, always will.  If you can't
  47. muster the discipline languages like C require of you, the B&D languages
  48. are down two groups and to the left.  Tell 'em "Nick" sent you.
  49.  
  50. -- 
  51. Dave Schaumann            dave@cs.arizona.edu
  52.