By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,684 Members | 1,439 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,684 IT Pros & Developers. It's quick & easy.

Which is better, C or C++

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

Feb 21 '06 #1
Share this Question
Share on Google+
33 Replies


P: n/a
On 20 Feb 2006 20:40:25 -0800, "Protoman" <Pr**********@gmail.com>
wrote in comp.lang.c++:
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.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Feb 21 '06 #2

P: n/a

Jack Klein wrote:
On 20 Feb 2006 20:40:25 -0800, "Protoman" <Pr**********@gmail.com>
wrote in comp.lang.c++:
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.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html


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

Feb 21 '06 #3

P: n/a
Protoman wrote:
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?

--
Scott McPhillips [VC++ MVP]

Feb 21 '06 #4

P: n/a
Protoman wrote:
Jack Klein wrote:
On 20 Feb 2006 20:40:25 -0800, "Protoman" <Pr**********@gmail.com>
wrote in comp.lang.c++:
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.


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


Did you also ask it in comp.lang.c? What reaction did you get there?
Feb 21 '06 #5

P: n/a
On Tue, 21 Feb 2006 00:55:44 -0500, "Scott McPhillips [MVP]"
<org-dot-mvps-at-scottmcp> wrote in comp.lang.c++:
Protoman wrote:
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?


Note, however, that it is a post increment. And we all know what that
means...

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Feb 21 '06 #6

P: n/a
"Protoman" <Pr**********@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Which is better for general-purpose programming, C or C++?
Yes.
My friend
says C++, but I'm not sure.
So why did you ask him/her?
Please enlighten me.
In comp.lang.c++, C++ is best.
In comp.lang.c, C is best
In comp.lang.fortran, fortran is best
In comp.lang...

Get the picture?
Thanks!!!!!


You're welcome.

BTW please read this:
http://www.slack.net/~shiva/welcome.txt

-Mike
Feb 21 '06 #7

P: n/a
"Protoman" <Pr**********@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
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.
Feb 21 '06 #8

P: n/a
Protoman wrote:
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.
Feb 21 '06 #9

P: n/a
probably where speed matters.. C is better, where security matters..
C++ is better..
depends on necessity.

Feb 21 '06 #10

P: n/a
kalyan wrote:
probably where speed matters.. C is better

FUD.

--
Ian Collins.
Feb 21 '06 #11

P: n/a
"Protoman" <Pr**********@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
: 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
--
http://ivan.vecerina.com/contact/?subject=NG_POST <- email contact form
Feb 21 '06 #12

P: n/a
kalyan wrote:
probably where speed matters.. C is better, where security matters..
C++ is better..
depends on necessity.


Nope.

Ben Pope
--
I'm not just a number. To many, I'm known as a string...
Feb 21 '06 #13

P: n/a
"kalyan" <ks**********@gmail.com> wrote in message
news:11*********************@g43g2000cwa.googlegro ups.com...
probably where speed matters.. C is better, where security matters..
C++ is better..
depends on necessity.

Wot do you mean by that?

--Wg-
Feb 21 '06 #14

P: n/a
nntp.aioe.org wrote:
"kalyan" <ks**********@gmail.com> wrote in message
news:11*********************@g43g2000cwa.googlegro ups.com...
probably where speed matters.. C is better, where security matters..
C++ is better..
depends on necessity.

Wot do you mean by that?


Apples are less fruity than oranges.

Ben Pope
--
I'm not just a number. To many, I'm known as a string...
Feb 21 '06 #15

P: n/a
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 ;)

Feb 21 '06 #16

P: n/a

Ivan Vecerina wrote:

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

Feb 21 '06 #17

P: n/a
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 ....
Feb 21 '06 #18

P: n/a
Protoman wrote:
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.

--
Mike Smith

Feb 21 '06 #19

P: n/a
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
Feb 21 '06 #20

P: n/a
Jack Klein wrote:
On 20 Feb 2006 20:40:25 -0800, "Protoman" <Pr**********@gmail.com>
wrote in comp.lang.c++:
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.


I plonked him a while back for some other shenanigans.

Brian
Feb 21 '06 #21

P: n/a
Jim Langston wrote:
"Protoman" <Pr**********@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
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.


You can plonk in OE, I believe. I haven't used it in some time (it's
really not that good) but I see to recall that capability.

See here:

http://www.hyphenologist.co.uk/killf...filefaqhtm.htm


Brian
Feb 21 '06 #22

P: n/a

Jacek Dziedzic wrote:
Protoman wrote:
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".


adj. Comparative of good.

1. Greater in excellence or higher in quality.
2. More useful, suitable, or desirable: found a better way to go; a
suit with a better fit than that one.
3. More highly skilled or adept: I am better at math than English.
4. Greater or larger: argued for the better part of an hour.
5. More advantageous or favorable; improved: a better chance of
success.
6. Healthier or more fit than before: The patient is better today.

Feb 21 '06 #23

P: n/a
In article <7r****************@newsread1.news.pas.earthlink.n et>, Mike
Wahler <mk******@mkwahler.net> writes
"Protoman" <Pr**********@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googleg roups.com...
Which is better for general-purpose programming, C or C++?


Yes.
My friend
says C++, but I'm not sure.


So why did you ask him/her?
Please enlighten me.


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


HERETIC!!!! FORTH is the only true Path
--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ ch***@phaedsys.org www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Feb 21 '06 #24

P: n/a
In article <kC******************@news.indigo.ie>, Tomás <NU**@NULL.NULL>
writes
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.


Though C is far more widely used and is likely to out last C++
--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ ch***@phaedsys.org www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Feb 21 '06 #25

P: n/a
Well of course C++ is better. I mean, do you really want to go to
comp.lang.c group to find out? Ignorance is bliss ;)

Feb 21 '06 #26

P: n/a
OK, I made my mind up: I'm going to become a C++ purist; I live for the
day when compilers that adhere to C++0x come out :-) Why is C still
around anyway? We don't need it, we have the glorious C++!!!! And what
are your thoughts on CC++ (not a typo; it stands for Concurrent C++, a
direct superset of C++ that also natively supports multiprocessor
programming)?

Feb 21 '06 #27

P: n/a
In article <11*********************@g44g2000cwa.googlegroups. com>,
Protoman <Pr**********@gmail.com> writes
OK, I made my mind up: I'm going to become a C++ purist; I live for the
day when compilers that adhere to C++0x come out :-) Why is C still
around anyway? We don't need it, we have the glorious C++!!!!


Because most embedded systems use C. There are a lot more of them around
than PC's by an order of several magnitudes. from 8-128 bit MCUs For
many of the targets there are not C++ compilers.

That said on a PC C has virtually died out. I think that given that Java
C# and C++/CLI from MS is predominate in the PC world C++ is likely to
die out before C.

However that does not answer the question as to which is better. IT
depends what you are doing. If most of your work is going to be on a PC
then go for C++.

--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ ch***@phaedsys.org www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Feb 21 '06 #28

P: n/a
That said on a PC C has virtually died out. I think that given that Java
C# and C++/CLI from MS is predominate in the PC world C++ is likely to
die out before C.


Still, can a large-scale project which requirements include high-performance
(think AAA games, 3D related software, etc) really rely on C# in its current
form?

AFAIK C++ is has just a small overhead on top of plain C in term of raw
performance while C# has a much bigger one.

--
JT
Feb 22 '06 #29

P: n/a

Jim Langston wrote in message ...

Protoman... I remember you.

I just wish outlook had a ploink file.


Tools-->Newsgroup Filters... [add]

View-->Current View-->Filtered Messages [un-check]

--
Bob R
POVrookie
Feb 22 '06 #30

P: n/a

"Protoman" <Pr**********@gmail.com> skrev i meddelandet
news:11**********************@o13g2000cwo.googlegr oups.com...

Jack Klein wrote:
On 20 Feb 2006 20:40:25 -0800, "Protoman" <Pr**********@gmail.com>
wrote in comp.lang.c++:
> 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.


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

Which fruit is better for general consumption, apples or oranges?
To answer your question, we will first have to agree on what we mean
by "better" and "general-purpose".

That will never happen. :-)
Bo Persson
Feb 22 '06 #31

P: n/a
On 2006-02-21, ro**********@gmail.com <ro**********@gmail.com> wrote:

Jacek Dziedzic wrote:
Protoman wrote:
> 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".


adj. Comparative of good.

1. Greater in excellence or higher in quality.
2. More useful, suitable, or desirable: found a better way to go; a
suit with a better fit than that one.
3. More highly skilled or adept: I am better at math than English.
4. Greater or larger: argued for the better part of an hour.

So C++ *is* better in at least one sense. Though I wouldn't want to
try to construct that sentence.

Personally, I defer to Protoman's friend on these matters.

--
Neil Cerutti
The Minutemen are not tall in terms of height. --Dan Bonner
Feb 22 '06 #32

P: n/a
Jeremiah Tesla <te***@tlnewsreader.com> writes:
That said on a PC C has virtually died out. I think that given that Java
C# and C++/CLI from MS is predominate in the PC world C++ is likely to
die out before C.


Still, can a large-scale project which requirements include high-performance
(think AAA games, 3D related software, etc) really rely on C# in its current
form?

AFAIK C++ is has just a small overhead on top of plain C in term of raw
performance while C# has a much bigger one.


Why don't you do a benchmark of the two and see if the overhead is *acceptable*
for the project.

S.
Feb 28 '06 #33

P: n/a
A "good" C programmer will make a "better" C++ programmer. You could
always program in C++ and have the compiler output C code (clumsy in
several applications).

Mar 1 '06 #34

This discussion thread is closed

Replies have been disabled for this discussion.