Which is better, C or C++

P

Protoman

Which is better for general-purpose programming, C or C++? My friend
says C++, but I'm not sure. Please enlighten me. Thanks!!!!!
 
J

Jack Klein

Which is better for general-purpose programming, C or C++? My friend
says C++, but I'm not sure. Please enlighten me. Thanks!!!!!

Each of them is both better than the other.

Questions like this will get you plonked as a troll in short order.
 
P

Protoman

Jack said:
Each of them is both better than the other.

Questions like this will get you plonked as a troll in short order.

Why would I get plonked? I'm just asking a simple question.
 
S

Scott McPhillips [MVP]

Protoman said:
Which is better for general-purpose programming, C or C++? My friend
says C++, but I'm not sure. Please enlighten me. Thanks!!!!!

What part of "++" is hard for you to understand?
 
J

Jim Langston

Protoman said:
Which is better for general-purpose programming, C or C++? My friend
says C++, but I'm not sure. Please enlighten me. Thanks!!!!!

Protoman... I remember you.

I just wish outlook had a ploink file.
 
J

Jacek Dziedzic

Protoman said:
Which is better for general-purpose programming, C or C++? My friend
says C++, but I'm not sure. Please enlighten me. Thanks!!!!!

Define "better".

- J.
 
K

kalyan

probably where speed matters.. C is better, where security matters..
C++ is better..
depends on necessity.
 
I

Ivan Vecerina

: Which is better for general-purpose programming, C or C++? My friend
: says C++, but I'm not sure. Please enlighten me. Thanks!!!!!

Just a humble perspective of mine:


C remains the "portable assembly language", available on nearly
every processor architecture in use, including the most obscure
embedded controllers. It provides low-level control, has a large
user base, and is relatively easy to learn (if you have any
understanding of assembly or machine languages).

C++ was designed to leverage this foundation, while integrating
support for high-level programming paradigms (object-orientation,
generics, error handling with exceptions, better extensibility
and resource management). Personally I find it painful to write
large programs without taking advantages of these features.
However, getting a complete understanding of C++ takes much
more time and effort -- giving C++ the reputation of being
elitist, a language for specialists.


I am using both, as well as higher-level scripting languages
(Perl, PHP, Python, ...), and will look into platform-specific
extensions of C++ when the time comes ( e.g. C++/CLI ).

The better tool always depends on the job to be done, the
people you are working with, and a number of other factors.


What is your definition of "general-purpose programming" ?

Regards,
Ivan
 
G

Gernot Frisch

In comp.lang.c++, C++ is best.
In comp.lang.c, C is best
In comp.lang.fortran, fortran is best

A good FORTRAN programmer can write FORTRAN code in _any_ language ;)
 
M

ma740988

Ivan said:
C++ was designed to leverage this foundation, while integrating
support for high-level programming paradigms (object-orientation,
generics, error handling with exceptions, better extensibility
and resource management). Personally I find it painful to write
large programs without taking advantages of these features.
However, getting a complete understanding of C++ takes much
more time and effort -- giving C++ the reputation of being
elitist, a language for specialists.

Well said!! Unfortunately all the noise pertaining to code bloat/slow
and the C++ standard library's use (some call it the STL ) in embedded
will never end. When I first decided to embrace the language, that's
all I ever heard from the 'C' purists.

The most recent argument I've heard pertains to the
re-compilation/re-linking saga when dealing with templates. Granted
I've haven't done much investigation but in a nutshell. gcc apparently
does a * couple * iterations of re-compile/re-link when dealing with
templates. Not sure why ... but ..
 
P

pbruno

Protoman ha scritto:
Which is better for general-purpose programming, C or C++? My friend
says C++, but I'm not sure. Please enlighten me. Thanks!!!!!
In my opinion it depends on what you have to manage. If you have to
manage little project, not complex, C (in my experience) is better than
C++ becouse you spend less money. If you have to manage a big project
OOP is quite usefull for code reuse, scalability, design and so on, so
I'd use C++ . I don't find this a stupid question, and I don't have a
fix response ....
 
M

Mike Smith

Protoman said:
Which is better for general-purpose programming, C or C++? My friend
says C++, but I'm not sure. Please enlighten me. Thanks!!!!!

Oh, joy. Another round of "innocent questions" from Protoman.
 
T

Tomás

Protoman posted:
Which is better for general-purpose programming, C or C++? My friend
says C++, but I'm not sure. Please enlighten me. Thanks!!!!!

C++.

It has all the features of C, plus more feature like classes,
inheritance, polymorphism, templates.

The C Programming language is dead in my mind.


-Tomás
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,175
Messages
2,570,946
Members
47,497
Latest member
PilarLumpk

Latest Threads

Top