Re: Languages for embedded

CBFalconer wrote:
moschops wrote:
... snip ...
There are some old-school embedded coders at my workplace who
mumble about how C++ is not really a real-time language and that
C is better for such applications. I can certainly understand not
using something with automatic garbage collection (you never know
for sure when everything will pause for the memory to be cleaned
up, as I understand it), but why avoid C++? Is there something
about the classes and templates that makes it unsuitable for
embedded software? What affects the decision to use a given
language for embedded coding? I'd be grateful to hear about
reasons for/against other languages besides C and C++.

First, realize that C++

[snip list of evil vendor-specific languages ...]

cannot do anything that C can't do, although it may
require some more programming, or libraries.

Can't ... resist ... flame ... bait ... :-)

Can C do templates/generics? Well ... I suppose you *could*
re-write the same code with different types every time you
needed to use the same algorithm.

In a similar way, you can also code your own
polymorphisms in C using structures and function pointers.
Certainly, the Linux kernel does.

I'm working on a gadget I call a wheel ;-)

Sorry ... I'm incurable :-)

Michael N. Moran (h) 770 516 7918
5009 Old Field Ct. (c) 678 521 5460
Kennesaw, GA, USA 30144

"So often times it happens, that we live our lives in chains
and we never even know we have the key."
"Already Gone" by Jack Tempchin (recorded by The Eagles)

The Beatles were wrong: 1 & 1 & 1 is 1