Re: C vs C++ in Embedded Systems?

From: Antti Keskinen (antti.keskinen_at_REMOVEME.koti.luukku.com)
Date: 01/28/05


Date: Fri, 28 Jan 2005 23:21:00 +0200


"Mayank Kaushik" <prehistorictoad2k@yahoo.com> wrote in message
news:1106934623.176433.166230@z14g2000cwz.googlegroups.com...
> Hi,
>
> How do C and C++ compare vis-a-vis Embedded Systems? And how about with
> respect to any kind of hardware-level programming? Just asking out of
> curiosity, so plz dont qualify your answer!
>
> Regards
> Mayank
>

C is more popular and more 'streamlined' (doesn't contain anything fancy)
for smaller embedded systems. It can't be used for true object-oriented
programming, but who needs OO on 8-bit processors ? Designing something like
an RTOS requires OO, presumably, but an RTOS on an 8-bit processor ? Isn't
that a bit like overshoot ?

C++ is sometimes so loaded with different features and possibilities that
it's just too huge for it's task. I prefer using C or assembly on an
embedded system, and C++ when I'm designing applications for Windows or
Linux. The only place where I need C++ on an embedded system is when I'm
doing something for Windows Embedded or Linux Embedded.

Like they say, "C++ makes it harder to shoot yourself in the foot, but when
you do, you'll blow off the entire leg." Me, for one, am not interested in
losing my foot when creating a simple frequency doubler for a Intel MCS96..
I'll just use C or assembly :D

-Antti Keskinen



Relevant Pages

  • Re: Standalone and non-standalone applications in embedded systems
    ... > A fully conforming free-standing implementation only has to provide ... so RTOS vendor may define its own behaviour for abort. ... RTOS is required on host to develop an embedded system. ...
    (comp.arch.embedded)
  • Re: What is the difference b/w rtos and embedded system.
    ... An embedded system may run an RTOS, a best effort OS or no OS. ... An RTOS is an operating system that guarantees "real-time" response. ... real-time RTOS typically contains a scheduler that ensures that the ...
    (comp.os.vxworks)
  • Howto measure system load
    ... I am currently looking for a solution to measure the application load on my embedded system. ... An approach I though about was hacking the RTOS I am using and every time the idle task is scheduled I count up the time in this task for a given time frame. ... Specially I am looking for options where I don't need to hack the RTOS. ...
    (comp.arch.embedded)
  • Re: Hi,Which Embedded os is suitable for new user to learn?
    ... If I want to learn embedded system, ... Micro-OSII is good but lacks the ability that a true OS should have - the ... I would stick to linux. ... Most embedded systems don't use an RTOS ...
    (comp.arch.embedded)