Re: C vs C++ in Embedded Systems?

From: Jonathan Kirwan (jkirwan_at_easystreet.com)
Date: 01/31/05


Date: Mon, 31 Jan 2005 22:02:42 GMT

On 31 Jan 2005 21:35:18 GMT, Grant Edwards <grante@visi.com> wrote:

>On 2005-01-31, Jonathan Kirwan <jkirwan@easystreet.com> wrote:
>
>> Despite all this, though. There are real reasons and good
>> justifications for treating C++ in embedded systems with a
>> great deal of respect and perhaps some trepidation. I think
>> using it well imposes a higher standard of expertise on the
>> programmer. It's a language for the more skilled among us.
>
>Which seems to me to illustrate a the fundamental problem with
>C++. The higher level the language, the _less_ skill and
>expertise should be required of the programmer. Writing
>Assembly code should require less expertise than writing
>machine code. Writing C code should require less expertise than
>Assembly. Writing in an higher level language (OO or not)
>should require _less_ expertise than C, not more. I think
>that's true for most high level languages: Modula-3, Ada,
>Scheme, Python, Smalltalk, etc.
>
>The fact that writing C++ is more difficult and requires more
>expertise than writing in a lower level language means
>something went seriously wrong in the design of C++. The
>purpose of a language is to make it easier to program, not more
>difficult.

I meant my comments, though, in the very narrow situation of using C++ for
critical embedded applications of the nature I mentioned in my earlier post,
years back.

In the case of less critical systems, a great many programmers can use
Microsoft's MFC, for example, in order to handle window messaging and use the
supplied simplifying tools to modify the directing structures without really
understanding the details. It's blindly done, I suppose. But if one stays in
the mainstream, most problems can still be avoided, even by relatively ignorant
programmers.

Same thing is true for VB or Delphi, I suppose. Excellent tools for quick
prototyping, for example (not meant to exclude other meaningful uses.) There's
a lot that can be done with well-vetted higher level support. But then, I'd not
be trying to use these tools for the kind of critical embedded applications to
which I meant my comments to be directed.

...

However, between C++ and VB/Delphi, C++ still requires a fair degree of skill.
I kind of imagine C++ as a emeritus programmer's programming language. Often, a
very dangerous tool in neophyte hands and, yet, an incredibly powerful tool for
those nearer the pinnacle of the profession. One needs to have learned from
experience what works well over time and how to rule themselves with a
disciplinary iron fist. And that just takes time.

Jon



Relevant Pages

  • Re: Computer Algebra Algorithms lisp vs. C.
    ... a suitable language for CAS development. ... language is the bias of the programmer. ... it is the best language for writing ANY program. ...
    (sci.math.symbolic)
  • Re: How old is the average Fortran programmer?
    ... code in any language! ... it seems a C programmer is similarly capable of writing C at least ... that needed to write a C cross compiler for an embedded machine. ... The original programmer was trained in Pascal, ...
    (comp.lang.fortran)
  • Re: C vs C++ in Embedded Systems?
    ... expertise should be required of the programmer. ... Assembly code should require less expertise than writing ... Writing in an higher level language ...
    (comp.arch.embedded)
  • Re: A Fateman paper
    ... no language can prevent a bad programmer from writing bad code. ... This page attributes it to Moon in the form "No language can prevent ...
    (comp.lang.c)
  • Re: A Fateman paper
    ... no language can prevent a bad programmer from writing bad code. ... This page attributes it to Moon in the form "No language can prevent ...
    (comp.lang.c)