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