As a programmer of both languages...




There seems to be constant vacuous debate about which is better or
preferable, C or C++, and it looks like one of these discussions is on-
going right now in this newsgroup.

I'm a programmer who started out in C++, and who's currently doing
an embedded systems project in C. The relationship and comparison
between the two languages is very simple in my opinion.

The objective of C++ was to build upon C; to take everything that C
can do, and then add a few more features, such as classes, operator
overloading, and exceptions.

Overlooking the small differences between the common subset of the
two languages (e.g. converting from void*, the type of character
literals), it's quite accurate to say that C++ is C with some more added
features.

So at the most basic, you can say that C++ is better than C in that
it can do everything C can does, and that it has a few more extra
features. That's great and all, but the price to pay for these extra
features is the increased complexity of the compiler. I'm currently
writing a program for the PIC 16F684 microcontroller (which is less than
the size of a postage stamp), and there wouldn't be a snowball's chance
in hell of me finding a C++ compiler for it. Why? Because nobody's
bothered writing one. I mean *have* *you* *seen* the size of the C++
Standard? :-O Not only that, but when programming for embedded systems,
the nature of the programs doesn't tend to give rise to a desire for
object-orientated programming. The current program I'm writing is a
Connect4 game, and there hasn't be one instance yet in which I've
yearned for object orientation (even though I use classes extensively
when writing PC applications).

So my own point of view is that while C++ is the programming
language to be used today for PC's, game consoles and the like, C is
still the king when it comes to embedded systems, and that doesn't seem
like changing any time soon. And for the less-than-proficient among us,
there's Java for PC's, and Basic for micrcontrollers.

--
Tomás Ó hÉilidhe
.



Relevant Pages

  • Re: Simple question, err... I think
    ... Languages have lots of different features. ... First-class lexical closures (SML, OCaml, Haskell, ...) ... I just want to know what's different between the modern programming ...
    (comp.programming)
  • Re: core features and functions required in modern programming languages
    ... Having read/studied a few programming languages I would be interested to ... know the core features functions etc that would be most desired? ... listed below some features I would like to see. ...
    (comp.programming)
  • Re: Conformance
    ... better than C for certain types of programming, and C is better than C++ ... You think that C will lose because it has far less features than C++. ... currently a superior language. ... libraries, some of which were last updated decades ago. ...
    (comp.std.c)
  • Re: [OT] Re: Teaching new tricks to an old dog (C++ -->Ada)
    ... the evidence I find is that these Ada features meet programmers' ... with templates is almost never used. ... > specification of low-level features in e.g. multiprocessor environments. ... I think portable concurrent or distributed programming is a paradigm ...
    (comp.lang.ada)
  • Re: [OT] Re: Teaching new tricks to an old dog (C++ -->Ada)
    ... the evidence I find is that these Ada features meet programmers' ... with templates is almost never used. ... > specification of low-level features in e.g. multiprocessor environments. ... I think portable concurrent or distributed programming is a paradigm ...
    (comp.lang.cpp)