[chbot] C vs C++ and embedded

Michael Pearce mike at kiwacan.co.nz
Tue Dec 30 23:42:59 GMT 2008


There is a saying that is very true.....

 " Real Programmers Program in Assembly,
   Programmers that make money program in 'C'. "

Most of my embedded coding is in C (Microchip
PIC10,12,16,18,24,32,dsPIC) unless I require accurate software timing,
very fast interrupt or constrained for space, then I revert back to
assembly to optimize.

Had one client that only programs in Assembly.... they wanted to use
USB in a project and had 1 month to get it up and running..... in the
end he decided to learn 'C' and employ someone who already new 'C'.

Mike

On Tue, Dec 30, 2008 at 3:52 PM, Richard Jones <rjtp at ihug.co.nz> wrote:
> Nice poll Chris, Processor/Language.
> For my Micromouse I'm using AVR/avr-gcc(using C) hosted on PC Ubuntu Linux,
> future plans for Parallax Propeller/Image Craft C hosted under MS Windows.
> Feeling nervous about using C++ on an ATMega8 with 1K ram, 8k flash, but
> the article has made me wonder about the upsides.
>
> Richard
>
> On Wed, 31 Dec 2008 11:16:09 +1300, Chris Hellyar <chris at trash.co.nz>
> wrote:
>> That makes interesting reading, coming from someone who has avoided OOP
>> programming for ages, and only just got dragged in, kicking and
>> screaming in the last year or so.
>>
>> I'm a die-hard assembly fan for embedded stuff, which probably makes me
>> a dinosaur.  I suspect if it was still a part of my income I'd have
>> switched to C long ago though.  I find it's the thrill of the chase with
>> assembly which makes it interesting, but it also means it takes 5x as
>> long to get the same result. :-).
>>
>> Case in point would be my current modbus project.  There are some good
>> open source C code bases for modbus RTU on various platforms, but I'm
>> coding from scratch in assembler for PIC 'cause I can'.  200+ hours of
>> work and it's working well with a bunch of standard test tools, but in C
>> I think it would have been more like 30 hours work.
>>
>> Which leads me to a straw-poll question...  What are people using as
>> their tool set of choice for robots/gadgets?  What processor/language?
>> I'm 1 vote for PIC/asm. :-)
>>
>>
>>
>> Cheers, Me.
>>
>>
>> On Wed, 2008-12-31 at 09:56 +1300, Richard Jones wrote:
>>
>>> After the last meeting Paul was discussing with me the merits of using
>> 'C'
>>> structures and C vs C++. This article might prove interesting to anyone
>>> interested in the tradeoffs between C and C++ for embedded applications
>>> like robotics: http://www.embedded.com/98/9802fe3.htm
>>>
>>> Richard
>>>
>>>
>>> _______________________________________________
>>> Chchrobotics mailing list, web site: http://kiwibots.org
>>> Chchrobotics at lists.linuxnut.co.nz
>>> http://lists.ourshack.com/mailman/listinfo/chchrobotics
>>>
>
>
> _______________________________________________
> Chchrobotics mailing list, web site: http://kiwibots.org
> Chchrobotics at lists.linuxnut.co.nz
> http://lists.ourshack.com/mailman/listinfo/chchrobotics
>



-- 
Kiwacan
http://www.kiwacan.co.nz
http://www.kiwacandirect.com
USA: 1-800-490-2091
NZL:  +64-3-669-0077



More information about the Chchrobotics mailing list