Why is C++ so popular

B

Brian

I have not found an answer to the question why C++ is the most preferred
language. I thought it would be a good question to ask in this newsgroup
that has programmers that have been using C++ for a while.
I did read that its popular because it can be transferred to other
platforms but not everyone has more than one platform.
 
K

Krice

I have not found an answer to the question why C++ is the most preferred
language.

It's multi-paradigm which seems to be good in programming
languages since one paradigm alone can be restricting. C++
is mainly OOP language and I think OOP is the best paradigm
we have at the moment.

C++ has a good, clear syntax even it's "long" and some people
think it requires too much writing. Still, some programming
languages to me look like this: q:)+05,C-/(-Ae),"hello":r)
which explains why they are not as preferred. C++ is quite
easy to read if it's well written and don't have any fancy
programming magic.

C++ is also fast, a feature that can't be underestimated.
Most programs work better if they have that extra speed
coming from the simple low level structure of C++ executable.
 
B

BGB

I have not found an answer to the question why C++ is the most preferred
language. I thought it would be a good question to ask in this newsgroup
that has programmers that have been using C++ for a while.
I did read that its popular because it can be transferred to other
platforms but not everyone has more than one platform.

because it sucks less than the other options?...


many people tend to thing of things in terms of being "better" or "more
preferable" (like there is some significant "good" that pulls people to
a particular solution), but I suspect this may be backwards.

I suspect, instead, people tend to avoid serious drawbacks, and the
option the with least serious drawbacks wins by default.

historically, both C and C++ have been in a fairly good spot here.
this may be partly due to being reasonably free of crippling design
flaws (or, at least real design flaws, as opposed to people complaining
that it doesn't really follow idiom-X or fad-Y or prevents bad-practice-Z).

whereas, many other languages have had maybe a few nifty features, but
often at the cost of being seriously crippled or broken in some other
area (often denied, downplayed, or claimed to actually be a feature, by
people who endorse the language...).

usually, this is not about idioms, but rather, things which impede using
the language in one way or another (such as awkward or unreadable
syntax, broken semantics, ...), or limit its effectiveness at performing
an operation (such as arbitrary limitations, poor performance, tendency
to misbehave or be overly difficult to debug, ...).



so, most people largely end up using what works...

though, this is not to say it is perfect either, for that matter...
 
N

Nick Keighley

I have not found an answer to the question why C++ is the most preferred
language. I thought it would be a good question to ask in this newsgroup
that has programmers that have been using C++ for a while.
I did read that its popular because it can be transferred to other
platforms but not everyone has more than one platform.

to some extent its momentum, it's popular because it's popular. It's
apparent similarity to C probably has some historical significance. As
others have noted efficiency and access to the underlying machine is
important.

I'm curious, why do you care?
 
C

ctgqumgf

Am Donnerstag, 27. September 2012 10:44:23 UTC+2 schrieb Brian:
I have not found an answer to the question why C++ is the most preferred language. I thought it would be a good question to ask in this newsgroup that has programmers that have been using C++ for a while. I did read that its popular because it can be transferred to other platforms but not everyonehas more than one platform. -- Regards Brian

1) As Krice already mentioned its multi-paradigm is a big advantage. Even
in the same project you can switch between structural programming,
object-based programming and object-oriented programming. Of course one
would prefer OO but often there is working legacy ANSI-C (or even K&R-C)
code that has to be used.

2) My favorite reason is: because C++ is *alive* ! I don't know no other
language that has changed so much over time.

I can remember when the first compilers came out that really could
handle templates. It took quite a while for the C++ community to get
behind that new feature. The outcome was the STL and a totally new
programming paradigm: generic programming.

Now with C++11 the language recently changed even further. There are
now multi-core CPUs everywhere. And thus support for multithreading
(*finally*) has been added to C++.

And all this did not break existing code! With your newest top-notch
C++ compiler you can still compile your old K&R stuff from 1978 ...
 
R

Rui Maciel

Paavo said:
It isn't. Some other languages like C, Java and Objective-C are more
popular. See
http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html

Again with this TIOBE nonsense. Using the tiobe index to base any claim on
the popularity of a programming language makes as much sense as searching
for the name of a programming language on youtube, and claiming that it is
more popular than another because the search returned more hits. Because
that's precisely how the the people behind TIOBE rank programming languages.


Rui Maciel
 
R

Rui Maciel

2) My favorite reason is: because C++ is *alive* ! I don't know no other
language that has changed so much over time.

If you are a fan of C++ because of that then you would love Fortran.


Rui Maciel
 
B

Brian

BGB said:
because it sucks less than the other options?...


many people tend to thing of things in terms of being "better" or "more
preferable" (like there is some significant "good" that pulls people to a
particular solution), but I suspect this may be backwards.

I suspect, instead, people tend to avoid serious drawbacks, and the
option the with least serious drawbacks wins by default.

historically, both C and C++ have been in a fairly good spot here.
this may be partly due to being reasonably free of crippling design flaws
(or, at least real design flaws, as opposed to people complaining that it
doesn't really follow idiom-X or fad-Y or prevents bad-practice-Z).

whereas, many other languages have had maybe a few nifty features, but
often at the cost of being seriously crippled or broken in some other
area (often denied, downplayed, or claimed to actually be a feature, by
people who endorse the language...).

usually, this is not about idioms, but rather, things which impede using
the language in one way or another (such as awkward or unreadable syntax,
broken semantics, ...), or limit its effectiveness at performing an
operation (such as arbitrary limitations, poor performance, tendency to
misbehave or be overly difficult to debug, ...).



so, most people largely end up using what works...

though, this is not to say it is perfect either, for that matter...

Delphi use to be popular because it had a good structure when writing code.
I have programmed in Visual Basic but after a while the structure starts to
look untidy with too many programming words and so the program flow can be
difficult to see. So I'm looking at other programming languages and notice
that many seem to follow C with the curly brackets etc.
If I were to ask software companies what language the program they are
selling in written in then I have a feeling the answer would be either C or
C++.
There are many programming languages to chose from but for some reason
people seem to chose C++ maybe its the language that's taught in schools.
 
B

Brian

Nick Keighley said:
to some extent its momentum, it's popular because it's popular. It's
apparent similarity to C probably has some historical significance. As
others have noted efficiency and access to the underlying machine is
important.

I'm curious, why do you care?

I ask myself why should people program in C++ when Visual Basic is easier
to understand?
There must be a reason why C++ is chosen when there are many other
languages to chose from.
Maybe some people grow up with C and then moved on to C++ and its close to
what they had used in the past.
 
B

Brian

Am Donnerstag, 27. September 2012 10:44:23 UTC+2 schrieb Brian:

1) As Krice already mentioned its multi-paradigm is a big advantage. Even
in the same project you can switch between structural programming,
object-based programming and object-oriented programming. Of course one
would prefer OO but often there is working legacy ANSI-C (or even K&R-C)
code that has to be used.

I like a structured language but it must be difficult lining up those curly
brackets when trying to read a C++ program.
2) My favorite reason is: because C++ is *alive* ! I don't know no other
language that has changed so much over time.

But the code is still the same unless they have added more code commands.
I can remember when the first compilers came out that really could
handle templates. It took quite a while for the C++ community to get
behind that new feature. The outcome was the STL and a totally new
programming paradigm: generic programming.

Now with C++11 the language recently changed even further. There are
now multi-core CPUs everywhere. And thus support for multithreading
(*finally*) has been added to C++.

And all this did not break existing code! With your newest top-notch
C++ compiler you can still compile your old K&R stuff from 1978 ...

I can see that this would be an advantage. If I came across c++ code in a
old book then it should still work.
 
B

Brian

Paavo Helde said:
It isn't. Some other languages like C, Java and Objective-C are more
popular. See
http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html

In principle, one should choose the language according to the problem what
one is trying to resolve. If one is planning to do a multi-million line
complex and fast system, C++ is a good candidate (along with Ada and some
others). OTOH, a hundred line program can be written in anything.

In that case what is Visual Basic useful for?
 
B

Brian

Paavo Helde said:
Yeah, I brought up TIOBE as it looked like an exact match for the OP-s
weird claim ("C++ is the most preferred language"). All this popularity
stuff is quite meaningless anyway, so counting hits is no worse or better
than any other method IMO. PHP is very popular, it does not mean that it
would be a good idea to write my image analysis code in PHP.

Cheers
Paavo

Most of those surveys seem to have C++ at or near the top of the list.
To put it another way why should C++ be more popular than Visual Basic as
Visual Basic is easy to learn and there is less code to write?
 
B

Brian

Scott Lurndal said:
Or object-oriented COBOL.

There's still a lot of COBOL running out there in legacy systems.

scott

From memory Fortran was a Science language and Cobol was a Business
language. It didn't think that those languages were still supported then
again there are still some Quick Basic programmers.
 
B

Brian

Brian said:
I have not found an answer to the question why C++ is the most preferred
language. I thought it would be a good question to ask in this newsgroup
that has programmers that have been using C++ for a while.
I did read that its popular because it can be transferred to other
platforms but not everyone has more than one platform.

Correct me if I'm wrong but I see some programming languages as having
restrictions such as if I wanted to colour a ball then I might only have
the colours that the programing language offers me but what if I didn't
like the choices and wanted a different colour or maybe I wanted a shape
like a pear instead of a circle shaped ball but the only shapes offered
were square and circle. Maybe languages like C++ gives the programmer more
scope to design exactly what the programmer wants.
I know that early programming languages such as Basic had these
restrictions.
 
R

Rui Maciel

Brian said:
I ask myself why should people program in C++ when Visual Basic is easier
to understand?

Visual Basic is far from being free from criticism.

Nevertheless, some people don't program in C++ or even know how to, and they
still do quite well using some other programming language. There are plenty
of alternatives out there, and they aren't necessarily better or worse than
C++: only different.


Rui Maciel
 
N

Nick Keighley

I ask myself why should people program in C++ when Visual Basic is easier
to understand?

!!!!

Visual Basic I've seen looks pretty messy and it locks you to windows.
There must be a reason why C++ is chosen when there are many other
languages to chose from.

portabilty, low level access if needed, efficiency, portable,
availability of programmers, availability of programming environments
Maybe some people grow up with C and then moved on to C++ and its close to
what they had used in the past.

yes
 
N

Nick Keighley

Delphi use to be popular because it had a good structure when writing code.
I have programmed in Visual Basic but after a while the structure starts to
look untidy with too many programming words and so the program flow can be
difficult to see. So I'm looking at other programming languages and notice
that many seem to follow C with the curly brackets etc.
If I were to ask software companies what language the program they are
selling in written in then I have a feeling the answer would be either C or
C++.

yes but that's just a feeling. Complex products are often programmed
in a variety of languages. Languages like Python and Ruby are quick to
develop in but sometimes run rather sluggishly. C++ can be used in the
important bits to make everything go faster. Java is pretty popular as
is C#. Though you might see them as having a C-like syntax.
 
N

Nick Keighley

Most of those surveys seem to have C++ at or near the top of the list.
To put it another way why should C++ be more popular than Visual Basic as
Visual Basic is easy to learn and there is less code to write?

only until you start doing real work (ie. non-GUI). As poited out
before Visual Basic is totally tied to Windows.
 

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

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top