Re: C vs C++ in Embedded Systems?
From: Steven R. Wheeler (swheeler843_at_earthlink.net)
Date: 01/29/05
- Next message: Peter: "Re: firewire chip set"
- Previous message: rcepmail_at_gmail.com: "firewire chip set"
- In reply to: Tim Wescott: "Re: C vs C++ in Embedded Systems?"
- Next in thread: Guy Macon: "Re: C vs C++ in Embedded Systems?"
- Reply: Guy Macon: "Re: C vs C++ in Embedded Systems?"
- Reply: Jonathan Kirwan: "Re: C vs C++ in Embedded Systems?"
- Reply: Tim Wescott: "Re: C vs C++ in Embedded Systems?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 29 Jan 2005 11:33:59 -0700
Tim Wescott wrote:
> Grant Edwards wrote:
>
>> On 2005-01-28, Mayank Kaushik <prehistorictoad2k@yahoo.com> wrote:
>>
>>
>>> How do C and C++ compare vis-a-vis Embedded Systems?
>>
>>
>>
>> IMO, nobody should write a line of source code for an embedded
>> system unless they know ahead of time what code (more or less)
>> the compiler is going to generate. That's possible with C.
>>
>> The C++ language is so unbelievably complex and "feature"
>> ridden, that nobody ever quite knows what's going to happen
>> when they write a line of code.
>>
>> IOW, I don't approve of C++ for embedde use. Or for
>> non-embedded use, actually.
>>
> Yes on paying attention to compiler output, no on C++ paranoia.
>
> As long as you avoid the really dippy language features and don't touch
> the C++ standard libraries with a 10-foot pole you'll do OK. Most
> compilers only pull in the extra baggage for a feature if you use it, so
> if you don't use the feature you're OK. And if you have a compiler that
> _does_ pull in the baggage then don't use it!
>
> I've been programming headless embedded systems in C++ for eight years
> now with great success. It enables faster programming on large
> applications, easier factoring of jobs among a team, and significantly
> easier design-for-reuse. It _does_ require careful programming, and an
> idiot at the keyboard will bring you down faster than anything, but you
> get that with any programming language.
I'll agree with the "idiot at the keyboard" comment, but disagree on not
being paranoid about C++. Paranoia doesn't mean "don't use it ever," it
means "be concerned/afraid/careful."
This is a subject that comes up from time to time. One of the previous
times, I printed out a comment in the thread, just because it had very
good information about _why_ you should be paranoid about C++ in
embedded systems. It was written by Jonathon Kirwan, and he called it
"My World and Welcome To It." I've kept it around since then, because I
work on similarly small systems, but I'm starting to do more with
32-bitters and need to know about C++ since our customers ask for/about it.
You can find Mr. Kirwan's post here:
http://groups-beta.google.com/group/comp.arch.embedded/browse_thread/thread/36d06d841b7c8422/8c402e042e26d771?q=kirwan+%22my+world%22+C%2B%2B&_done=%2Fgroups%3Fq%3Dkirwan+%22my+world%22+C%2B%2B%26hl%3Den%26lr%3D%26tab%3Dng%26ie%3DUTF-8%26sa%3DN%26&_doneTitle=Back+to+Search&&d#8c402e042e26d771
-- wheels
- Next message: Peter: "Re: firewire chip set"
- Previous message: rcepmail_at_gmail.com: "firewire chip set"
- In reply to: Tim Wescott: "Re: C vs C++ in Embedded Systems?"
- Next in thread: Guy Macon: "Re: C vs C++ in Embedded Systems?"
- Reply: Guy Macon: "Re: C vs C++ in Embedded Systems?"
- Reply: Jonathan Kirwan: "Re: C vs C++ in Embedded Systems?"
- Reply: Tim Wescott: "Re: C vs C++ in Embedded Systems?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|