home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / cplus / 18798 < prev    next >
Encoding:
Internet Message Format  |  1993-01-12  |  3.0 KB

  1. Xref: sparky comp.lang.c++:18798 comp.object:4728
  2. Path: sparky!uunet!olivea!mintaka.lcs.mit.edu!ai-lab!life.ai.mit.edu!tmb
  3. From: tmb@arolla.idiap.ch (Thomas M. Breuel)
  4. Newsgroups: comp.lang.c++,comp.object
  5. Subject: Re: Pros and cons of C++
  6. Message-ID: <TMB.93Jan7174627@arolla.idiap.ch>
  7. Date: 8 Jan 93 01:46:27 GMT
  8. References: <C0Hp1n.vp@gpu.utcs.utoronto.ca>
  9. Reply-To: tmb@idiap.ch
  10. Organization: IDIAP (Institut Dalle Molle d'Intelligence Artificielle
  11.     Perceptive)
  12. Lines: 57
  13. NNTP-Posting-Host: arolla.idiap.ch
  14. In-reply-to: yjohn@gpu.utcs.utoronto.ca's message of 7 Jan 93 15:15:22 GMT
  15.  
  16. In article <C0Hp1n.vp@gpu.utcs.utoronto.ca> yjohn@gpu.utcs.utoronto.ca (John Ross) writes:
  17.  
  18.    I have recently come to grips with having to learn C++; mainly due to
  19.    the bandwagon effect. It doesn't look like there will be any pure C
  20.    programmers left in a couple of years.  I agree that the language is
  21.    very complex, and has many shortcomings. [...]
  22.  
  23.    Why then is it becoming so popular?  Why the deluge of texts, articles,
  24.    magazines, news groups, compilers, etc?
  25.  
  26. I think the reasons are mostly pragmatic ones:
  27.  
  28.  * C++ interfaces easily with C/FORTRAN code (for example, using
  29.    "Xlib" with C++ has been pretty trivial from the beginning; even a
  30.    language like Modula-2 or Ada, both of which are really quite
  31.    similar in character to C++, required "new bindings").
  32.  * Existing C programs can easily be recompiled as C++ programs.
  33.  * With a minimum of training, C programmers can fancy themselves
  34.    C++ programmers.
  35.  * The C subset of C++ runs about as fast (or as slowly) as C
  36.    code. For PCs and workstations, that is acceptable (for
  37.    supercomputers, it is not).
  38.  * While C/C++'s support for bittwiddeling is "all wrong", being
  39.    unportable and unsafe, at least it is there and works reasonably
  40.    efficiently.
  41.  * There are lots of compilers available (including GNU C++),
  42.    and there is lots of support. (Why are there lots of compilers
  43.    available? Because there are lots of users. Why are there lots
  44.    of users? Because C++ started out as a relatively modest
  45.    and simple extension of C.)
  46.  
  47. For each of the alternative languages (Modula-2, Ada, Modula-3,
  48. Smalltalk, CLOS, Eiffel, SML, etc.), some of these very pragmatic
  49. requirements are not satisfied.
  50.  
  51.    Anyway, enough rambling--what are your thoughts?  Do you use C++; will
  52.    you; what do you like, dislike about it; what is it's future; etc, etc?
  53.  
  54. What do I dislike about C++?
  55.  
  56.  * No type safety.
  57.  * No pointer safety.
  58.  * No arithmetic overflow detection.
  59.  * No module system to speak of.
  60.  * No garbage collection.
  61.  * Inefficient memory management.
  62.  * Hairy scoping rules.
  63.  * Hairy, implementation dependent linking.
  64.  * A number of important optimizations are impossible.
  65.  * Insufficient language support for separating implementation
  66.    dependent/unportable features from the rest of the language.
  67.  
  68. When I don't need to interface with existing C/FORTRAN code or when my
  69. algorithms get complicated enough that these latter problems with C++
  70. matter, I use a different language.
  71.  
  72.                     Thomas.
  73.