home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / alt / msdos / programm / 3021 < prev    next >
Encoding:
Internet Message Format  |  1992-12-27  |  2.9 KB

  1. Xref: sparky alt.msdos.programmer:3021 comp.os.msdos.programmer:11635 comp.sys.ibm.pc.programmer:682 comp.lang.c++:18440 comp.lang.c:18910
  2. Newsgroups: alt.msdos.programmer,comp.os.msdos.programmer,comp.sys.ibm.pc.programmer,comp.lang.c++,comp.lang.c
  3. Path: sparky!uunet!mole-end!mat
  4. From: mat@mole-end.matawan.nj.us
  5. Subject: Re: Newbie Wants Advice on C-Programming
  6. Message-ID: <1992Dec27.031157.27179@mole-end.matawan.nj.us>
  7. Organization: :
  8. References: <1992Dec23.220530.15347@netcom.com> <1992Dec24.172333.7339@grebyn.com> <1992Dec25.070024.15672@grebyn.com>
  9. Date: Sun, 27 Dec 1992 03:11:57 GMT
  10. Lines: 55
  11.  
  12. In article <1992Dec25.070024.15672@grebyn.com>, malak@grebyn.com (Michael Malak) writes:
  13. > In article <1hdpluINN1lv@agate.berkeley.edu> faustus@ygdrasil.CS.Berkeley.EDU (Wayne A. Christopher) writes:
  14. > >In article <1992Dec24.172333.7339@grebyn.com> malak@grebyn.com (Michael Malak) writes:
  15.  
  16. > >> ...  I feel the following must be learned in order:
  17. > >>   1) Pascal, with two semesters experience
  18.  
  19. > >IMHO, Pascal has nothing useful that C doesn't have, except for array
  20. > >bounds checking.  You you use C++ you can use a vector class that
  21. > >gives you that.
  22.  
  23. > Pascal has the following advantages over C:
  24. >    1) It has structured syntactic blocks for constants, types and
  25. >       variables.
  26.  
  27. This is no advantage.
  28.  
  29. A program is a model: an abstraction expressed in a representation.  The
  30. Pascal seperation of constant, type, and variable classifies the tools of
  31. representation; it is irrelevant within a program.  Would you require a
  32. cook to measure out all the ingredients specified by tablespoons before
  33. measuring any ingredient specified by cups?
  34.  
  35. >    2) It has nested procedures.
  36.  
  37. True to a point.  See Kernighan's _Why Pascal is not my Favorite Programming
  38. Language_ for the limitations of nested procedures.
  39.  
  40. >    3) Most importantly, the good structured programming professors
  41. >       wouldn't be caught dead teaching C (biggotry in my opinion).
  42.  
  43. Besides which, people who learn Pascal first seem to take three or four
  44. times as long to learn how to use C pointers as people who don't learn
  45. Pascal at all, and Pascal introduces people to some really poor habits.
  46.  
  47. The classical Pascal expression of a loop-and-a-half cannot be written
  48. as a while() because Pascal's expression syntax is too weak.  It cannot
  49. be written as a loop-and-a-half because Pascal doesn't allow a `break'
  50. from a loop.  What results is a circumlocution involving more code in
  51. control flow and temporary variable managing than in solving the problem;
  52. worse, one branch of an  if-then  is related to the circumlocution and
  53. one to the problem to be solved.  This is a very bad form of incohesion:
  54.  
  55.     if not X
  56.         manage the loop
  57.     else
  58.         solve the problem
  59.  
  60. This seems to me as damaging to potential software designers as BASIC
  61. is claimed to be to potential programmers.
  62. -- 
  63.  (This man's opinions are his own.)
  64.  From mole-end                Mark Terribile
  65.  
  66.  mat@mole-end.matawan.nj.us, Somewhere in Matawan, NJ
  67.