home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / misc / 3560 < prev    next >
Encoding:
Text File  |  1992-11-09  |  3.8 KB  |  68 lines

  1. Newsgroups: comp.lang.misc
  2. Path: sparky!uunet!ukma!usenet.ins.cwru.edu!agate!linus!linus.mitre.org!boole.mitre.org!crawford
  3. From: crawford@boole.mitre.org (Randy Crawford)
  4. Subject: Re: Pointers
  5. Message-ID: <1992Nov10.024021.8724@linus.mitre.org>
  6. Sender: news@linus.mitre.org (News Service)
  7. Nntp-Posting-Host: boole.mitre.org
  8. Organization: The MITRE Corporation, McLean, VA
  9. References: <1992Nov3.130634.26112@rdg.dec.com> <1992Nov4.031026.23624@linus.mitre.org> <1992Nov7.115620.29967@syacus.acus.oz.au>
  10. Date: Tue, 10 Nov 1992 02:40:21 GMT
  11. Lines: 55
  12.  
  13. >>In article <1992Nov3.130634.26112@rdg.dec.com> jch@rdg.dec.com (John Haxby) writes:
  14. >>>|> In article <1992Nov2.083810.1652@syacus.acus.oz.au> ian@syacus.acus.oz.au (Ian Joyner) writes:
  15. >>>|> You simply don't need C style pointers in decent programming languages.
  16. >>>
  17. >>>C's pointers don't actually provide anything useful, apart from,
  18. >>>perhaps, an ability to duplicate Lindsay's `triple ref' code.
  19.  
  20. [lots of tangential comments deleted]
  21.  
  22. I think that most of the preceding remarks have missed the original point
  23. that was made.  My defense of C's pointers was not an assertion that C is the 
  24. end-all of programming languages nor that pointers are the best way to do
  25. everything.  (Amazing how far afield these religious discussions can wander.)
  26.  
  27. C is a perfectly good model for a programming language.  Its design is quite
  28. consistent with a very successful genre of programming languages (FORTRAN, 
  29. Pascal, PL/1, BASIC, Algol).  C was designed so that its compiler might be 
  30. easy and fast to implement on various architectures (some with very little 
  31. available RAM) while producing good code and supporting low-level services.  
  32. If you disagree with this synopsis -- fine, argue among yourselves about 
  33. garbage collection if you like.  But given the above criteria, C has been a 
  34. major success.  Each of us will be damned lucky if we accomplish as much in 
  35. our lives as Dennis Ritchie did 23 years ago in inventing C.
  36.  
  37. That C isn't ideal for programming in the large, or highly numerical use, or
  38. automatic parallelization, or foolproof boo-boo checking isn't of interest to
  39. me and isn't the original complaint to which I responded.
  40.  
  41. I defy the critics in this forum to devise a programming language which has 
  42. the ability to outperform C given the constraints I have listed above.  Ever
  43. build a compiler to run in 20K of RAM and produce executables which must run
  44. in an equally tiny space?  What language would you prefer, Ada, PL/1 or perhaps
  45. Pascal?  Good luck.  If you hope to design a language as powerful and flexible 
  46. as C with a compiler as small, portable and simple, you will have to consider 
  47. as Dennis Ritchie did what it is you cannot live without in a programming 
  48. language.  I suspect that even with 23 years of hindsight that he did not have,
  49. your end product will look a lot like K&R C.  And it may well have _pointers_.
  50.  
  51. Remember too, that when C was born in 1969, most programmers were still 
  52. fighting with 300 baud modems, paper tape, and columnar punch cards.  A terse 
  53. powerful programming language like C, with user-defined types, dynamic memory 
  54. and free-form syntax was a huge step forward.  In a lot of ways, more modern 
  55. languages are still trying to catch up.  It was 1992 before Ada 9X offered us 
  56. pointers to functions.  But two decades ago they were available in C.
  57.  
  58. It's easy to nitpick a language to death for its faults while ignoring its 
  59. merits; especially so when it is discussed out of context, apart from its 
  60. history.  My original defense of C's pointers stands.  They are a remarkably
  61. useful construct which have served their purpose well.
  62.  
  63. -- 
  64.  
  65. | Randy Crawford        crawford@mitre.org        The MITRE Corporation
  66. |                                                 7525 Colshire Dr., MS Z421
  67. | N=1 -> P=NP           703 883-7940              McLean, VA  22102
  68.