home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / mac / system / 10207 < prev    next >
Encoding:
Internet Message Format  |  1992-07-21  |  1.9 KB

  1. Path: sparky!uunet!sun-barr!apple!apple!taligent!lsr.taligent.com!user
  2. From: lsr@taligent.com (Larry Rosenstein)
  3. Newsgroups: comp.sys.mac.system
  4. Subject: Re: C++ comments
  5. Message-ID: <lsr-210792133518@lsr.taligent.com>
  6. Date: 21 Jul 92 20:46:58 GMT
  7. References: <1992Jul21.124631.8584@msc.cornell.edu> <1992Jul21.192200.18180@tamsun.tamu.edu>
  8. Sender: usenet@taligent.com (More Bytes Than You Can Read)
  9. Followup-To: comp.sys.mac.system
  10. Organization: Taligent, Inc.
  11. Lines: 35
  12.  
  13. In article <1992Jul21.192200.18180@tamsun.tamu.edu>,
  14. bpb9204@tamsun.tamu.edu (Brent) wrote:
  15. > used for everything.  I'd personally shudder at writing a UNIX C compiler
  16. > in C++.  What would the objects be?  Would they be function definitions?
  17.  
  18. I could see classes related to symbol tables, code generation, object
  19. module format, optimizations, etc.  You have to define these abstractions
  20. anyway; in C++ they might as well be classes.  Plus you can do things like
  21. support different object module formats by subclassing.
  22.  
  23. > using all the object stuff, but the basic compilation process is too 
  24. > algorithmically intensive to bother with objects.  The ++ overhead would
  25. > slow down numerous method calls (the way C++ objects are implemented).
  26.  
  27. It's not necessary that there be any overhead in writing C++ code compared
  28. to C, because you don't have to use virtual function calls.  You lose the
  29. ability to subclass and override member functions, but you still gain the
  30. encapsulation that C doesn't have.
  31.  
  32. Even if you do use virtual function calls, the overhead is very small in
  33. C++.  I doubt that you would notice this overhead compared to things like
  34. I/O.
  35.  
  36. > the two; he had heard how great C++ is for everything and that he was trying
  37. > to make it work, but couldn't get it going.  I think this is more the case
  38.  
  39. Object design is not something that you can just pick up.  It takes some
  40. amount of practice.  There's no reason why one can't write a good compiler
  41. using C++.
  42.  
  43. Larry Rosenstein
  44. Taligent, Inc.
  45.  
  46. lsr@taligent.com
  47.