Quickie Poll -- C vs. C++

Fortran, C

I can do it and have the tools on hand.

when I need to be, no

32

C

Yes

Yes

Yes

BUT what *I'd* like to know is what development environments (if you'd call them that) folks use and for what application platforms?

Windows ..IX/...UX's uP/uC DSP

Why?

Fred

Reply to
Fred Marshall
Loading thread data ...
[snip C++ previous comments]

Very well stated.

A statement one frequently hears, that is misleading, is that one isn't doing true OO unless one uses inheritance, and in particular virtual functions, and therefore one is not utilizing the advantages of C++. This perspective is really only valid in certain very large software engineering projects. For the average engineer doing signal processing or communications, there is a large advantage to using the encapsulation and polymorphism aspects of C++, without even touching these "true OO" features.

C has weak encapsulation: a program is a flat set of function definitions and external variables. The "static" keyword can provide only one level of limited encapsulation. In C++, functions can be encapsulated within classes (e.g. they can be methods), and there are namespaces. There are the private/public feature of class membership; and you have the "friend" keyword, and while both of these are arguably blunt instruments, they are very useful and they are missing from C.

(All members of a "struct" in C are public, and while you can include function pointers -- messy -- you can't include functions.)

C has almost no polymorphism. In C++, there are templates, and there is generalized operator overloading.

The neat thing (for me) about C++ is that the above features allow you to organize your programs in a vastly better, and ultimately simpler fashion; yet it still maintains the model of separate compilation; it is still very efficient. You do not have to give up entirely, and go to an interpreted model, just to get OO-style programming language features.

Steve

Reply to
Steve Pope

Are you talking about IDEs (Integrated Development Environments), like Visual Studio? If so, you're asking a question near and dear to my heart.

In all cases I use:

  1. emacs and gnumake for editing/building 2. either the native debugger (e.g., Code Composer Studio) or gdb for debugging.

If I'm under Windoze, I install cygwin.

Why? I dunno, I guess I'm a crochety old fart. Otherwise, some of these might be valid reasons:

  1. It's the little things. Like having the same shortcut keys no matter what I'm editing.

  1. A dual- (or more) target compilation system I've built up over a lot of years. With it I can usually coerce at least some pieces of the code to build either for the target (e.g., for the DSP) or natively under the operating system (e.g., using gcc and linux). That can be a real advantage since it's usually much, MUCH faster to debug your code natively.

  2. Although many IDEs have improved in this area, I still feel like I have better control over my own project directory hierarchy and compile and link options. E.g., I'm always sure what my compile options are without having to hunt through 25 menus and dialog tabs, and I can implement file-specific compile options if I desire.

  1. The ability to add test or other special targets, e.g., a target that runs a test using specific files and pulls up Octave to check results.

--
Randy Yates                      % "And all that I can do
Digital Signal Labs              %  is say I'm sorry, 
mailto://yates@ieee.org          %  that's the way it goes..."
http://www.digitalsignallabs.com % Getting To The Point', *Balance of Power*, ELO
Reply to
Randy Yates

But since C is a subset of C++, there's nothing preventing you from writing just as simple a program in C++.

If you're using some C++ feature that is not in C, you are doing so for a reason. In a not insignificant number of cases, the reason is that the C++ feature makes the program even simpler. (e.g. not having to use function pointers, having complex number already in the language standard, etc.)

Steve

Reply to
Steve Pope

Em 27/8/2010 16:07, fatalist escreveu: [snipped]

Humm... and this anecdotal project was supposed to run in which embedded platform?

--
Cesar Rabak
GNU/Linux User 52247.
Get counted: http://counter.li.org/
Reply to
Cesar Rabak

That's (pretty much) true. However, there is more to it than just the syntax. The C compiler itself is simpler and I believe more robust, and error messages are easier to understand.

That is certainly possible. I still would jump on C for a simple project. I am much more familiar with it than C++, and it's simpler. Sometimes even having the ability to do something fancy can be a distraction, e.g., it gives you a choice you must decide.

--
Randy Yates                      % "How's life on earth? 
Digital Signal Labs              %  ... What is it worth?" 
mailto://yates@ieee.org          % 'Mission (A World Record)', 
http://www.digitalsignallabs.com % *A New World Record*, ELO
Reply to
Randy Yates

And how is this relevant to the Topic "C vs C++"?

It seems you can read but not understand the meaning of the words. You still cannot quote. You said nothing against my arguments.

I think I know better who should go back to school - I suggest the primary school. Andreas

--
Andreas Hünnebeck | email: acmh@gmx.de
----- privat ---- | www  : http://www.huennebeck-online.de
Fax/Anrufbeantworter: 0721/151-284301
GPG-Key: http://www.huennebeck-online.de/public_keys/andreas.asc
PGP-Key: http://www.huennebeck-online.de/public_keys/pgp_andreas.asc
Reply to
Andreas Huennebeck

Assembler and C

I lack the courage to use FORTH. :)

C only.

8 bit

4k to 64k

All the library routines I use are written in assembler and I can't imagine using anything else for my projects.

Yes

ts?

Yes

a
Reply to
Viktor

Op Wed, 25 Aug 2010 23:50:17 +0200 schreef Tim Wescott :

Depending on the task at hand: Korn shell, C, Java.

Shell is good for simple things on a high level, C allows better control over I/O and program flow, Java allows the same control but with much richer libraries.

I would describe myself as being competent. I find it comforting to know that until now I never did have to know the intricate details of both C and C++; just C is enough.

  1. Assuming you mean the size of its ALU.

16 kiB and up.

I would be happier knowing the quality of the code and the description of its interface. If I knew nothing other than the language, I would be happier knowing that somebody internal could debug it if necessary.

Yes.

Usually.

Yes, sympathetic hardware engineers do exist. But unfortunately they can be so enthusiastic about their design that it becomes hard to follow them.

--
Gemaakt met Opera's revolutionaire e-mailprogramma:  
http://www.opera.com/mail/
(remove the obvious prefix to reply by mail)
Reply to
Boudewijn Dijkstra

Could it have been the Weitek 1167(?)?

Reply to
JosephKK

Found it--Infotek. This is an announcement of the second version of the compiler. IEEE Computer Society News, February 1986.

Infotek Systems, BC204 Basic Compiler Compiler The BC 204 is compatible with HP 9000 Series 200/300 technical workstations and compiles Hewlett-Packard Basic version 4.0. Compiled programs operate with Infotek's FP 200 or FP 210 floating-point coprocessors and the HP 98635 floating-point coprocessor. Cost: $880. Infotek Systems, 1400 N. Baxter St., Anaheim, CA 92806; (714) 956-9300.

A company history is at

formatting link

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
Reply to
Phil Hobbs

Found it--Infotek. This is an announcement of the second version of the compiler. IEEE Computer Society News, February 1986.

Infotek Systems, BC204 Basic Compiler Compiler The BC 204 is compatible with HP 9000 Series 200/300 technical workstations and compiles Hewlett-Packard Basic version 4.0. Compiled programs operate with Infotek's FP 200 or FP 210 floating-point coprocessors and the HP 98635 floating-point coprocessor. Cost: $880. Infotek Systems, 1400 N. Baxter St., Anaheim, CA 92806; (714) 956-9300.

A company history is at

formatting link

Foggy memory is clearing up: the first coprocessor board was a 432, but the second one was a 68881.

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