DSPRelated.com
Forums

Quickie Poll -- C vs. C++

Started by Tim Wescott August 25, 2010
So, I'm working on a spare-time project that's off the back burner for 
at least a day.  It's a trainer, and I'd _like_ to be able to set it up 
so that advanced students can do their own programming.  Hence, the poll.

So, since anyone who responds to a dippy poll on USENET is obviously 
100% representative of the embedded software engineering public, I know 
that your responses will accurately reflect reality.

If you answer this poll you will _not_ be entered into a contest to win 
an iPod, or a free smokeless cigarette, or anything else.  So do it for 
the glory, and to advance the state of the species.

Please don't fire up the C vs. C++ flame war -- we all know that Forth 
is the best language in the world next to Python, so C vs. C++ is really 
moot anyway.

What is your _preferred_ programming language for smallish (1000 lines 
of code) projects?  C?  C++?  Something else?  What?

Why?

Would you describe yourself as being competent in both C and C++?  If 
only one, which?

What size processor(s) do you most often find yourself using?  8 bit? 
16?  32?

What size of memory space do you most often find yourself using?  Less 
than 1kbyte?  1 to 8kbyte? 8 to 64kbyte? More than 64kbyte?

If you had to use someone's library code in your smallish project and 
knew nothing about it other than the language it's written in, would you 
be happier knowing it was in C, C++ or some other language?

Are you comfortable reading schematics of digital circuits?

Are you comfortable reading schematics of mixed analog and digital circuits?

If you can't read schematics, can you find your way around a block 
diagram?  Can you understand explanations of circuit behavior given by a 
sympathetic hardware engineer?

Thanks.

-- 

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com

Do you need to implement control loops in software?
"Applied Control Theory for Embedded Systems" was written for you.
See details at http://www.wescottdesign.com/actfes/actfes.html
On Aug 25, 2:50&#4294967295;pm, Tim Wescott <t...@seemywebsite.com> wrote:
> So, I'm working on a spare-time project that's off the back burner for > at least a day. &#4294967295;It's a trainer, and I'd _like_ to be able to set it up > so that advanced students can do their own programming. &#4294967295;Hence, the poll. > > So, since anyone who responds to a dippy poll on USENET is obviously > 100% representative of the embedded software engineering public, I know > that your responses will accurately reflect reality. > > If you answer this poll you will _not_ be entered into a contest to win > an iPod, or a free smokeless cigarette, or anything else. &#4294967295;So do it for > the glory, and to advance the state of the species. > > Please don't fire up the C vs. C++ flame war -- we all know that Forth > is the best language in the world next to Python, so C vs. C++ is really > moot anyway. > > What is your _preferred_ programming language for smallish (1000 lines > of code) projects? &#4294967295;C? &#4294967295;C++?
I would have to say both. Since I use VC++ to build projects involving PCB, I usually end up with at least one PC/VC++ program.
> &#4294967295;Something else? &#4294967295;Why?
Visual Studio 5.0, if you consider it a language. Because I have it and it's good enough.
> > Why?
Quick and dirty user interfaces.
> > Would you describe yourself as being competent in both C and C++? &#4294967295;If > only one, which?
Both, but I always stay with the C subset if possible. Just habit.
> > What size processor(s) do you most often find yourself using? &#4294967295;8 bit? > 16? &#4294967295;32?
8 or 32. Nothing in between.
> > What size of memory space do you most often find yourself using? &#4294967295;Less > than 1kbyte? &#4294967295;1 to 8kbyte? 8 to 64kbyte? More than 64kbyte?
32K to 64K.
> > If you had to use someone's library code in your smallish project and > knew nothing about it other than the language it's written in, would you > be happier knowing it was in C, C++ or some other language?
C is usually easier to pick up on. But once you are familiar with it, you don't feel much differences between them. I have been using MFC/C+ + libraries without thinking too much. On the micro side, it's almost always C.
> > Are you comfortable reading schematics of digital circuits?
Yes.
> > Are you comfortable reading schematics of mixed analog and digital circuits?
Yes.
> > If you can't read schematics, can you find your way around a block > diagram? &#4294967295;Can you understand explanations of circuit behavior given by a > sympathetic hardware engineer?
Yes.
> > Thanks.
Do I get a cookie at least?
> > -- > > Tim Wescott > Wescott Design Serviceshttp://www.wescottdesign.com > > Do you need to implement control loops in software? > "Applied Control Theory for Embedded Systems" was written for you. > See details athttp://www.wescottdesign.com/actfes/actfes.html
In article <jpadnZIwv8-hDejRnZ2dnUVZ_hqdnZ2d@web-ster.com>, 
tim@seemywebsite.com says...
> > So, I'm working on a spare-time project that's off the back burner for > at least a day. It's a trainer, and I'd _like_ to be able to set it up > so that advanced students can do their own programming. Hence, the poll. > > So, since anyone who responds to a dippy poll on USENET is obviously > 100% representative of the embedded software engineering public, I know > that your responses will accurately reflect reality.
Smooth talker... :-^
> If you answer this poll you will _not_ be entered into a contest to
win
> an iPod, or a free smokeless cigarette, or anything else. So do it for > the glory, and to advance the state of the species.
I have too many offers of this or laptops already.
> Please don't fire up the C vs. C++ flame war -- we all know that Forth > is the best language in the world next to Python, so C vs. C++ is really > moot anyway. > > What is your _preferred_ programming language for smallish (1000 lines > of code) projects? C? C++? Something else? What?
Usually C
> Why?
I have a lot of simple blocks (reuse) that makes it quicker to build up. Especially for proofs of principle.
> Would you describe yourself as being competent in both C and C++? If > only one, which?
Competent in C, compotent in reading C++, to understand what others have done. Very little of what I do seems to benefit from C++ for a quick turnaround. Example TWO ASIC testers from purchase order to delivery of full package built, cased and documented in under two months, that is me doing everything, as well as other jobs.
> What size processor(s) do you most often find yourself using? 8 bit? > 16? 32?
Last ten years 16 now more 32bit as even small ARMS are generally cheaper with wider choice of toolchains.
> What size of memory space do you most often find yourself using? Less > than 1kbyte? 1 to 8kbyte? 8 to 64kbyte? More than 64kbyte?
Now comes the killer question FLASH/RAM or Both? Flash 8k to 512K, RAM from 1K to 2MB depending on type of application from simple control to video data processing.
> If you had to use someone's library code in your smallish project and > knew nothing about it other than the language it's written in, would you > be happier knowing it was in C, C++ or some other language?
I would be happier knowing it worked and had sufficient coverage for functionality to be useable. Efficiency also matters, not some library made by a PC for everything which can just have more RAM and larger processor to cope with bad design.
> Are you comfortable reading schematics of digital circuits?
Yes
> Are you comfortable reading schematics of mixed analog and digital circuits?
Most
> If you can't read schematics, can you find your way around a block > diagram? Can you understand explanations of circuit behavior given by a > sympathetic hardware engineer?
I am usually the sympathetic hardware engineer to other programmers and tend to document interface hardware and/or software (or comms protocol).
> Thanks.
-- Paul Carpenter | paul@pcserviceselectronics.co.uk <http://www.pcserviceselectronics.co.uk/> PC Services <http://www.pcserviceselectronics.co.uk/fonts/> Timing Diagram Font <http://www.gnuh8.org.uk/> GNU H8 - compiler & Renesas H8/H8S/H8 Tiny <http://www.badweb.org.uk/> For those web sites you hate
On Wed, 25 Aug 2010 14:50:17 -0700, Tim Wescott wrote:

> So, I'm working on a spare-time project that's off the back burner for > at least a day. It's a trainer, and I'd _like_ to be able to set it up > so that advanced students can do their own programming. Hence, the > poll. > > So, since anyone who responds to a dippy poll on USENET is obviously > 100% representative of the embedded software engineering public, I know > that your responses will accurately reflect reality. > > If you answer this poll you will _not_ be entered into a contest to win > an iPod, or a free smokeless cigarette, or anything else. So do it for > the glory, and to advance the state of the species. > > Please don't fire up the C vs. C++ flame war -- we all know that Forth > is the best language in the world next to Python, so C vs. C++ is really > moot anyway. > > What is your _preferred_ programming language for smallish (1000 lines > of code) projects? C? C++? Something else? What?
For typical small PC projects: Perl, C, Bourne shell For embedded projects: C, assembly
> Why?
For small PC projects like reformatting data, doing regex match and replace is easier in Perl than C, and Perl's associative arrays are easy to use.
> Would you describe yourself as being competent in both C and C++? If > only one, which?
Both, but prefer C to C++.
> What size processor(s) do you most often find yourself using? 8 bit? > 16? 32?
Back in the day, used 6-bit IBM 1620 a couple of years, and IBM 1130 and 1800 briefly; 12-bit PDP-8 a lot (wrote time sharing and process control), 16-bit PDP-11 a lot (and other 16-bit - DG Nova, Honeywell DDP-516), the occasional 24-bit Harris/Datacraft, some 36-bit machines (IBM 7044 and 7094, GE/Honeywell 645, Univac 1110), 48-bit CDC 3600 (wrote a CDC 6500 emulator on it, also wrote some assembly that unfortunately used a few instructions the system engineers had removed the circuitry of), 60-bit CDC 6500 (has 2 60-bit 6400-style CPU's and 10 12-bit PP's, vs the 6600's 1 faster central processor and 10 peripheral processors), Cyber 173. Now, mostly using 8-bit micros and 64-bit PC's.
> What size of memory space do you most often find yourself using? Less > than 1kbyte? 1 to 8kbyte? 8 to 64kbyte? More than 64kbyte?
Less than 1KB on micros, 20KB - 2000KB program sizes on PC
> If you had to use someone's library code in your smallish project and > knew nothing about it other than the language it's written in, would you > be happier knowing it was in C, C++ or some other language?
If you mean include some code, I'd prefer C, Perl, Java, Python to C++. If you mean include compiled binaries, the programming language seems less important than the quality of documentation describing the programming interface and the methods or algorithms. Actually, that probably applies to source code packages as well.
> Are you comfortable reading schematics of digital circuits?
Yes
> Are you comfortable reading schematics of mixed analog and digital > circuits?
Mostly
> If you can't read schematics, can you find your way around a block > diagram? Can you understand explanations of circuit behavior given by a > sympathetic hardware engineer?
A what? -- jiw
On 25/08/2010 22:50, Tim Wescott wrote:
> So, I'm working on a spare-time project that's off the back burner for > at least a day. It's a trainer, and I'd _like_ to be able to set it up > so that advanced students can do their own programming. Hence, the poll. > > So, since anyone who responds to a dippy poll on USENET is obviously > 100% representative of the embedded software engineering public, I know > that your responses will accurately reflect reality. > > If you answer this poll you will _not_ be entered into a contest to win > an iPod, or a free smokeless cigarette, or anything else. So do it for > the glory, and to advance the state of the species. > > Please don't fire up the C vs. C++ flame war -- we all know that Forth > is the best language in the world next to Python, so C vs. C++ is really > moot anyway. > > What is your _preferred_ programming language for smallish (1000 lines > of code) projects? C? C++? Something else? What?
C - but you better know C++
> Why?
C is more compact and easy to understand in small progs
> Would you describe yourself as being competent in both C and C++? If > only one, which?
Both
> What size processor(s) do you most often find yourself using? 8 bit? 16? > 32?
8 for embedded.
> What size of memory space do you most often find yourself using? Less > than 1kbyte? 1 to 8kbyte? 8 to 64kbyte? More than 64kbyte?
8-64kB
> If you had to use someone's library code in your smallish project and > knew nothing about it other than the language it's written in, would you > be happier knowing it was in C, C++ or some other language?
C
> Are you comfortable reading schematics of digital circuits?
Yes
> Are you comfortable reading schematics of mixed analog and digital > circuits?
Yes
> If you can't read schematics, can you find your way around a block > diagram? Can you understand explanations of circuit behavior given by a > sympathetic hardware engineer? > > Thanks.
I hope so -- Dirk http://www.transcendence.me.uk/ - Transcendence UK http://www.blogtalkradio.com/onetribe - Occult Talk Show
"Tim Wescott" <tim@seemywebsite.com> wrote in message 
news:jpadnZIwv8-hDejRnZ2dnUVZ_hqdnZ2d@web-ster.com...
> What is your _preferred_ programming language for smallish (1000 lines > of code) projects? C? C++? Something else? What? > > Why?
Somewhere between assembly and C. Assembly is compact and easy to understand (if dry to read and write). If you insist on only C vs. C++, then use the asm directive. ;)
> Would you describe yourself as being competent in both C and C++? If > only one, which?
C.
> What size processor(s) do you most often find yourself using? 8 bit? > 16? 32?
8
> What size of memory space do you most often find yourself using? Less > than 1kbyte? 1 to 8kbyte? 8 to 64kbyte? More than 64kbyte?
32k
> If you had to use someone's library code in your smallish project and > knew nothing about it other than the language it's written in, would you > be happier knowing it was in C, C++ or some other language?
Yech, assembly. A library written in anything else is just asking for bloat...piled on top of bloat.
> Are you comfortable reading schematics of digital circuits?
Yes
> Are you comfortable reading schematics of mixed analog and digital > circuits?
Yes
> If you can't read schematics, can you find your way around a block > diagram? Can you understand explanations of circuit behavior given by a > sympathetic hardware engineer?
I can also write them ;-) Tim -- Deep Friar: a very philosophical monk. Website: http://webpages.charter.net/dawill/tmoranwms
On 25/08/2010 22:50, Tim Wescott wrote:

> What is your _preferred_ programming language for smallish (1000 lines > of code) projects? C? C++? Something else? What?
Modula2 (but you can use anything for 1KLOC or smaller projects even ASM)
> > Why?
Extremely robust compilers and static analysis testers available. Though now a bit long in the tooth it is still good for mission critical code. Catches many common typos and faults at compile time.
> > Would you describe yourself as being competent in both C and C++? If > only one, which?
Both.
> > What size processor(s) do you most often find yourself using? 8 bit? 16? > 32?
16 or 32 bit mostly (but sometimes 8 bit PICs).
> > What size of memory space do you most often find yourself using? Less > than 1kbyte? 1 to 8kbyte? 8 to 64kbyte? More than 64kbyte?
>1MB
> > If you had to use someone's library code in your smallish project and > knew nothing about it other than the language it's written in, would you > be happier knowing it was in C, C++ or some other language?
Ada, Algol, Modula2, PASCAL or FORTRAN. If it has to be between C or C++ then C++ but using only a robust compact subset of the language. Some of these languages tend to bring in the kitchen sink as bloatware.
> > Are you comfortable reading schematics of digital circuits?
Yes.
> > Are you comfortable reading schematics of mixed analog and digital > circuits?
Yes.
> If you can't read schematics, can you find your way around a block > diagram? Can you understand explanations of circuit behavior given by a > sympathetic hardware engineer?
What is a sympathetic hardware engineer ;-) Regards, Martin Brown

Tim Wescott wrote:


> What is your _preferred_ programming language for smallish (1000 lines > of code) projects? C? C++? Something else? What?
What is the best screwdriver: phillips or straight?
> Would you describe yourself as being competent in both C and C++?
Being competent or incompetent is a quality of a person. C/C++ is irrelevant.
> What size processor(s) do you most often find yourself using? 8 bit? > 16? 32?
Usually BGA, sometimes TQFP.
> What size of memory space do you most often find yourself using? Less > than 1kbyte? 1 to 8kbyte? 8 to 64kbyte? More than 64kbyte?
I use no more memory then needed. Sometimes I have to use less.
> If you had to use someone's library code in your smallish project and > knew nothing about it other than the language it's written in, would you > be happier knowing it was in C, C++ or some other language?
Which pen do you prefer: green, black or blue? Why?
> Are you comfortable reading schematics of digital circuits? > Are you comfortable reading schematics of mixed analog and digital > circuits?
Good schematics is a piece of art; bad schematics is a discomfort.
> If you can't read schematics, can you find your way around a block > diagram?
Blocks are for blockheads.
> Can you understand explanations of circuit behavior given by a > sympathetic hardware engineer?
Are there any sympathetic hardware engineers? Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
Tim Wescott wrote:
> So, I'm working on a spare-time project that's off the back burner for > at least a day. It's a trainer, and I'd _like_ to be able to set it up > so that advanced students can do their own programming. Hence, the poll. > > So, since anyone who responds to a dippy poll on USENET is obviously > 100% representative of the embedded software engineering public, I know > that your responses will accurately reflect reality. > > If you answer this poll you will _not_ be entered into a contest to win > an iPod, or a free smokeless cigarette, or anything else. So do it for > the glory, and to advance the state of the species. > > Please don't fire up the C vs. C++ flame war -- we all know that Forth > is the best language in the world next to Python, so C vs. C++ is really > moot anyway. > > What is your _preferred_ programming language for smallish (1000 lines > of code) projects? C? C++? Something else? What?
REXX or C++, except when programming microcontrollers.
> > Why?
My productivity in REXX is about 10x that in any other language, but it runs 100x slower than C/C++. Once I get out of the REXX league, I generally use C++. I have a bunch of useful libraries that I've written over the years.
> > Would you describe yourself as being competent in both C and C++? If > only one, which?
Reasonably competent in both, though there are many, many C++ styles that are almost distinct languages. I'm most comfortable in the C-plus-classes-plus-templates subset. I generally don't use exceptions or STL.
> > What size processor(s) do you most often find yourself using? 8 bit? > 16? 32?
8 or 32.
> > What size of memory space do you most often find yourself using? Less > than 1kbyte? 1 to 8kbyte? 8 to 64kbyte? More than 64kbyte?
All of the above. More often bigger, these days.
> > If you had to use someone's library code in your smallish project and > knew nothing about it other than the language it's written in, would you > be happier knowing it was in C, C++ or some other language?
C. There are usually a zillion prerequisites for random C++ libraries.
> Are you comfortable reading schematics of digital circuits?
North American ones. I've never had to bother with the opaque European ones.
> > Are you comfortable reading schematics of mixed analog and digital > circuits?
Sure thing.
> > If you can't read schematics, can you find your way around a block > diagram? Can you understand explanations of circuit behavior given by a > sympathetic hardware engineer? > > Thanks. >
Cheers Phil Hobbs -- Dr Philip C D Hobbs Principal ElectroOptical Innovations 55 Orchard Rd Briarcliff Manor NY 10510 845-480-2058 hobbs at electrooptical dot net http://electrooptical.net
On 26/08/2010 23:23, Phil Hobbs wrote:
> Tim Wescott wrote: >> >> What is your _preferred_ programming language for smallish (1000 lines >> of code) projects? C? C++? Something else? What? > > REXX or C++, except when programming microcontrollers.
That is a blast from the past! REXX was the native OS/2 scripting language. I didn't know it was still going. Good while it lasted tho. Are you by any chance the Hobbs of the Hobbs OS/2 archive or is it just a coincidental name collision? OS/2 was a fabulous operating system deliberately hobbled by an IBM marketing department determined to make it fail to protect their midrange system sales. In the end they lost both and more besides. Regards, Martin Brown