Quickie Poll -- C vs. C++

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
 Click to see the full signature
Reply to
Tim Wescott
Loading thread data ...

l.

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.

Visual Studio 5.0, if you consider it a language. Because I have it and it's good enough.

Quick and dirty user interfaces.

Both, but I always stay with the C subset if possible. Just habit.

8 or 32. Nothing in between.

32K to 64K.

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.

Yes.

ts?

Yes.

a

Yes.

Do I get a cookie at least?

Reply to
linnix

Smooth talker... :-^

win

I have too many offers of this or laptops already.

Usually C

I have a lot of simple blocks (reuse) that makes it quicker to build up. Especially for proofs of principle.

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.

Last ten years 16 now more 32bit as even small ARMS are generally cheaper with wider choice of toolchains.

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.

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.

Yes

Most

I am usually the sympathetic hardware engineer to other programmers and tend to document interface hardware and/or software (or comms protocol).

--
Paul Carpenter          | paul@pcserviceselectronics.co.uk
    PC Services
 Click to see the full signature
Reply to
Paul

For typical small PC projects: Perl, C, Bourne shell For embedded projects: C, assembly

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.

Both, but prefer C to C++.

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.

Less than 1KB on micros, 20KB - 2000KB program sizes on PC

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.

Yes

Mostly

A what?

--
jiw
Reply to
James Waldby

C - but you better know C++

C is more compact and easy to understand in small progs

Both

8 for embedded.

8-64kB

C

Yes

Yes

I hope so

--
Dirk

http://www.transcendence.me.uk/ - Transcendence UK
 Click to see the full signature
Reply to
Dirk Bruere at NeoPax

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. ;)

C.

8

32k

Yech, assembly. A library written in anything else is just asking for bloat...piled on top of bloat.

Yes

Yes

I can also write them ;-)

Tim

--
Deep Friar: a very philosophical monk.
Website: http://webpages.charter.net/dawill/tmoranwms
Reply to
Tim Williams

Awk, specifically gawk (the GNU version). It's like a baby C, it's a precursor to perl. The three letters of the name are the authors, and the K is same person co-wrote C. (K&R). The language has some useful quirks and to my mind can handle most jobs from one-liners to fairly hairy log file filtering and 'real-time' firewall processing.

Old. well known, free, actively maintained, has its own comp.lang.awk group.

I've written programs in both, worked on linux-kernel code.

On small stuff, 8bit I work in assembler. These days I work on Linux or unix for higher level stuff and have no concern if the box is 32 or

64 bit.
8048 is tiny, as are the PIC chips. At the other end I don't care, there's swap ;)
C

Yup.

Yup.

That too.

You're welcome ;)

Grant.

Reply to
Grant

Modula2

(but you can use anything for 1KLOC or smaller projects even ASM)

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.

Both.

16 or 32 bit mostly (but sometimes 8 bit PICs).

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.

Yes.

Yes.

What is a sympathetic hardware engineer ;-)

Regards, Martin Brown

Reply to
Martin Brown

What is the best screwdriver: phillips or straight?

Being competent or incompetent is a quality of a person. C/C++ is irrelevant.

Usually BGA, sometimes TQFP.

I use no more memory then needed. Sometimes I have to use less.

Which pen do you prefer: green, black or blue? Why?

Good schematics is a piece of art; bad schematics is a discomfort.

Blocks are for blockheads.

Are there any sympathetic hardware engineers?

Vladimir Vassilevsky DSP and Mixed Signal Design Consultant

formatting link

Reply to
Vladimir Vassilevsky

REXX or C++, except when programming microcontrollers.

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.

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.

8 or 32.

All of the above. More often bigger, these days.

C. There are usually a zillion prerequisites for random C++ libraries.

North American ones. I've never had to bother with the opaque European ones.

Sure thing.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal
 Click to see the full signature
Reply to
Phil Hobbs

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

Reply to
Martin Brown

Yes, I remember doing some scripting back in the 90s with REXX, in OS/2. Nice language, as I recall.

Some old Commodore users remember it too, since it was included in some Amigas. Well, it's still around. Debian Linux packages a REXX interpreter called Regina, for example.

Wasn't it Hobbes? I always assumed it was named after that famous philosopher Thomas Hobbes. Or alternatively, Calvin's tiger...

Reply to
Anssi Saari

That one's easy. Phillips. The screwdriver can't slide out when tightening/loosening the screw.

Reply to
JW

And a green pen is better than a blue one or a black one - it stands out better for commenting on printed documents, and it gives the reader a warm fuzzy feeling that the notes are "green" and friendly.

Some of Tim's questions were vague and you can't give a decent answer without more information. But I think they were interesting nonetheless, and he has got some good answers. You wouldn't pick a library based solely on the language it uses (though you might rule out a contender based on the language). But it is certainly possible to say that the choice of language may be a positive point or a negative point when you are weighing up library choices against each other.

Reply to
David Brown

OS/2 showed much promise, I tried and I tried to use it but IBM just couldn't fix the bugs. And, I'd never heard a stressed out hard drive before -- that started swapping (paging) storm early in boot and it didn't stop. Very soon I doubled memory from 4MB to 8MB (cost $400) and it was much better. I've still got some of the red books that came out about the same time, for os/2.

Then Win95 crippled version came out and we still have that same GUI

15 years later.

Grant.

Reply to
Grant

No, Hobbes the archive is named after Hobbes the philosopher (the law of the jungle character), possibly by way of Hobbes the tiger. I've used Hobbes a lot, though.

I used to be an OS/2 diehard--I still have a triple boot OS2/XP/Red Hat system.

REXX started out on mainframes in about 1985, and is available for Linux and Windows among other things. The best classic REXX interpreter out there is Regina, and there's also the Open Object Rexx interpreter that has all sorts of object-oriented extensions, and now works in 64-bit.

So as long as you can build the executables, REXX should stay around. Really a good language for scripting in--the code is tight and readable.

Cheers

Phil

--
Dr Philip C D Hobbs
Principal
 Click to see the full signature
Reply to
Phil Hobbs

Is that pronounced conventionally, or Canadian?

Tim

--
Deep Friar: a very philosophical monk.
Website: http://webpages.charter.net/dawill/tmoranwms
Reply to
Tim Williams

Torx or Robertson. They don't cam out and strip the head.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal
 Click to see the full signature
Reply to
Phil Hobbs

Robertson all the advantage of the phillips plus some :). Robertson screws are widely available in Canada and less so in other places. screwdriver will not slip out even if

formatting link

Walter..

--- news://freenews.netfront.net/ - complaints: snipped-for-privacy@netfront.net ---

Reply to
Walter Banks

I think it's Latin for 'queen', to go with 'rex' for 'king', which would be 'regeena' (hard-G for Virgilians, soft G for everyone else).

Of course 'Rex' is more of a dog name, so maybe 'Regina' should be translated 'Queenie'.

Cheers

Phil

--
Dr Philip C D Hobbs
Principal
 Click to see the full signature
Reply to
Phil Hobbs

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.