The Future of C++ ?

B

blangela

If you had asked me 5 years ago about the future of C++, I would have
told you that its future was assured for many years to come. Recently,
I have been starting to wonder.

I have been teaching C++ at a local polytechnical school here in
Vancouver, Canada for approximately 8 years. Six years ago, at the
height (or should I say volume?) of the internet bubble, I had 80+
students per semester in my C++ course. Now I am fortunate to have 15
students per semester. What has changed? I believe that students are
no longer interested in learning C++. They would rather learn .NET
languages or Java (my colleages who teach these courses seem to be very
busy!). I believe it is because these other languages are easier to
learn and/or are perceived to be more relevant today.

I do believe that C++ is more difficult to learn than many of these
other languages. Despite my best efforts to make them exciting, I see
the eyes of my students start to glaze over when I start explaining
pointers. When I ask them to tokenize an english sentence (using the
strtok() function) and print the token in reverse order (they need to
declare an array of type char * and save the addresses of the tokens in
this array), I experience near panic from many of my students. But
these concepts need to be taught in a responsible C++ course. As was
pointed out to me recently, Microsoft still requires applicants to
demonstrate a very good knowledge of string manipulation using C-style
strings (none of these fancy string class objects!) when recruiting C++
programmers.

The ironic part is there is still a large demand for C++ developers
here in Vancouver. In fact, the company that I believe employs the
most developers here in Vancouver, employs almost entirely C++
programmers. This company, Electronic Arts (if you have not heard of
them, I guarantee that your kids have -- they create video games) is
only one of several gaming companies here in Vancouver that employ
primarily C++ programmers. Other companies like Kodak, MDSA, Nokia,
MDSI, etc. also employ large numbers of C++ programmers. Not
surprisingly, I have talked to several companies here in Vancouver who
are complaining that they are having difficulty finding C++ developers
and are looking at trying to recruit from abroad (eastern Europe
primarily).

I believe that many of these companies will be forced to migrate away
from C++ in the near future, simply because they will not be able to
find C++ programmers in the future. Soon the baby boomer C++
programmers will begin to retire, then the proverbial @@@@ will really
start to hit the fan!

Please tell me I am wrong, and paint me a view of the future which
includes C++.
 
A

Alf P. Steinbach

* blangela:
If you had asked me 5 years ago about the future of C++, I would have
told you that its future was assured for many years to come. Recently,
I have been starting to wonder.

I have been teaching C++ at a local polytechnical school here in
Vancouver, Canada for approximately 8 years. Six years ago, at the
height (or should I say volume?) of the internet bubble, I had 80+
students per semester in my C++ course. Now I am fortunate to have 15
students per semester. What has changed? I believe that students are
no longer interested in learning C++. They would rather learn .NET
languages or Java (my colleages who teach these courses seem to be very
busy!). I believe it is because these other languages are easier to
learn and/or are perceived to be more relevant today.

I do believe that C++ is more difficult to learn than many of these
other languages. Despite my best efforts to make them exciting, I see
the eyes of my students start to glaze over when I start explaining
pointers. When I ask them to tokenize an english sentence (using the
strtok() function)

There you have it: you're teaching the hard C parts first. Am I right
that these students who're choosing between Java, C# and C++ have no
programming background? I then think learning C# (or even JavaScript!)
first is a good idea wrt. learning programming, and learning Java a good
idea wrt. learning something helpful in getting a job without learning
more first.

and print the token in reverse order (they need to
declare an array of type char * and save the addresses of the tokens in
this array), I experience near panic from many of my students. But
these concepts need to be taught in a responsible C++ course. As was
pointed out to me recently, Microsoft still requires applicants to
demonstrate a very good knowledge of string manipulation using C-style
strings (none of these fancy string class objects!) when recruiting C++
programmers.

Again, teach 'em use of standard library classes first. std::string
isn't fancy. Show that C++ can be a productive language at that level.

After learning "high level" C++, teach them in a separate course about
the C subset.

Course e.g. entitled "The C subset of C++: pointers & other hairy
stuff", where for example you can go into why two-phase initialization
isn't a very bright idea in general, but why it's necessary on some
limited platforms such as Symbian C++ (lacking C++ exceptions).
 
P

Phlip

blangela said:
Please tell me I am wrong, and paint me a view of the future which
includes C++.

Modern C++ is a very powerful language, and the existing literature and
corpus of example software lags far behind its capacities.

Java and .NET thrive due to "management by magazine". Because the price of
C++ is a high risk of bugs, marketects can advertise Java (and its direct
clone) as "safer and more robust".

Programmers who actually learn C++ are directly competitive with the VM
languages. Those languages typically _reduce_ their available features, to
make code appear easier to make right. This generally causes you to write
more cruft in those languages.

A C++ programmer will deliberately but _voluntarily_ reduce their set of
working techniques, till they are using ones with matching robustness.

(Note, Java-philes, I did _not_ say smart pointers are the equivalent of
Java references. Each has different robustness profiles.)

The distinction is C++ programmers have the _option_ to get closer to the
metal, when they need it.

Contrarily, the majority of programming these days is high-level; trivially
gluing applications together from large-scale components, such as GUIs and
databases. The GUIs and databases themselves should be slowly written once,
in C++. The high-level code should be rapidly written in a safer and more
flexible scripting language.

There may not always be a world for average C++ coders, but there will
always be a world for the C++ code itself.
 
S

shabbir

I would frame it that way that people are running behind short term
gain.

I am a C++ programmer myself and havent had any training or havent read
any book of C# but I am doing job in C# for 8-9 months now without
facing any real problem and thats because I was good at C++.

When they run for one technology they become lame in a sense that its
temporary and C++ is more or less the base and so its permanent.

As we see now C# has descendant like F# and so you cannot be learning
each of them but if you have the base you can opt for anything anytime
and so still I think C++ is the future.

Thanks
Shabbir
 
L

loufoque

blangela said:
When I ask them to tokenize an english sentence (using the
strtok() function) and print the token in reverse order (they need to
declare an array of type char * and save the addresses of the tokens in
this array), I experience near panic from many of my students.

Maybe students just don't come because they think your course is bad.
They want to learn C++, not C.


As was
pointed out to me recently, Microsoft still requires applicants to
demonstrate a very good knowledge of string manipulation using C-style
strings (none of these fancy string class objects!) when recruiting C++
programmers.

Thankfully, Microsoft is not the only company where you can do programming.
Plus Microsoft isn't really doing C++ anyway, more like C with classes.
 
R

Roland Pibinger

I have been teaching C++ at a local polytechnical school here in
Vancouver, Canada for approximately 8 years. Six years ago, at the
height (or should I say volume?) of the internet bubble, I had 80+
students per semester in my C++ course. Now I am fortunate to have 15
students per semester. What has changed? I believe that students are
no longer interested in learning C++.

I do believe that C++ is more difficult to learn than many of these
other languages.

IMO, that's the main reason. C++ is unnecessarily and unproductively,
sometimes even ridiculously complex (see e.g.
http://www.bookpool.com/ct/98031). There has been no effort in the
last 10 or so years to make it easier and more accessible. Quite the
contrary, an influential group of people even tries to 'boost' C++ by
continuously introducing yet another level of complexity.
Despite my best efforts to make them exciting, I see
the eyes of my students start to glaze over when I start explaining
pointers.
But
these concepts need to be taught in a responsible C++ course. As was
pointed out to me recently, Microsoft still requires applicants to
demonstrate a very good knowledge of string manipulation using C-style
strings (none of these fancy string class objects!) when recruiting C++
programmers.

C++ is a highly fragmented language. When C++ is discussed one must
always ask: Which C++? Visual C++ (MFC), Embedded C++, Qt C++, C with
classes (the most popular C++), Boost C++, Addison Wesley C++, Game
Programmer C++, ...? This confusing fragmentation is sometimes
reinterpreted as advantage and C++ is touted as 'multiparadigm'
language.
The ironic part is there is still a large demand for C++ developers
here in Vancouver. I have talked to several companies here in Vancouver who
are complaining that they are having difficulty finding C++ developers
and are looking at trying to recruit from abroad (eastern Europe
primarily).

There is still demand for C++ developers but currently there is higher
demand for developers in other languages, esp. Java (until the bubble
bursts again).
I believe that many of these companies will be forced to migrate away
from C++ in the near future, simply because they will not be able to
find C++ programmers in the future. Soon the baby boomer C++
programmers will begin to retire, then the proverbial @@@@ will really
start to hit the fan!

AFAIK, you can program games today in any language, preferably C#.

The real solution would be C++2, a new version of the C++ language
(not an extension of the current language). I should avoid the
numerous traps, pitfalls and wrong defaults of the current language.
C++2 could be compatible with (but not a superset of) current C and
C++ (through a compatibility mode). Of course, that's a futile
proposal. That kind of language evolution happens in Python, Ruby,
PHP, ... but not in C++.

Best regards,
Roland Pibinger
 
C

Chris Thomasson

loufoque said:
Refcounting is not the same as a GC.

You can get very similar guarantees' wrt strong atomic thread-safety
level... And, as you know, one can always get around cyclic references via.
clean/coherent synchronization scheme, or custom and/or "built-into-details"
weak pointer logic...

http://groups.google.com/group/comp.programming.threads/browse_frm/thread/f2c94118046142e8
(more on true atomic refcounting... interesting thread indeed... ?)



I would argue that a coupling of clean synchronization interface in which
cyclic references are rare, with some lightweight weak-pointer scheme would
give you strong guarantees' of Java references, in C++, but at a
lower-level... You have more control over the atomic operations and memory
barrier operations, and you don't need to tie yourself to a VM "system"
API...

Humm...
 
L

loufoque

Roland said:
C++ is a highly fragmented language. When C++ is discussed one must
always ask: Which C++? Visual C++ (MFC), Embedded C++, Qt C++, C with
classes (the most popular C++), Boost C++, Addison Wesley C++, Game
Programmer C++, ...? This confusing fragmentation is sometimes
reinterpreted as advantage and C++ is touted as 'multiparadigm'
language.

Looks like you didn't get it at all. They're just frameworks. Libraries.
It's the same C++ but the libraries are designed differently and use
different language features.

Java, for example, also has multiple frameworks, even for one unique
thing (GUI, game development...)

The multiparadigm aspect isn't related to that at all. C++ is said to be
multiparadigm because it has supports for various kinds of programming
paradigms : imperative, object-oriented, generic, and possibly more.

AFAIK, you can program games today in any language, preferably C#.

Games is one of the key domains that really need an efficient language
like C++...

The real solution would be C++2, a new version of the C++ language
(not an extension of the current language). I should avoid the
numerous traps, pitfalls and wrong defaults of the current language.
> C++2 could be compatible with (but not a superset of) current C and
> C++ (through a compatibility mode).

The main traps and pitfalls in C++ are from its compatibility with C.
 
P

Phlip

loufoque said:
Refcounting is not the same as a GC.

In terms of language advocacy, C++ gives you the tools to build whatever
quasi-GC system you want (including a true GC). It doesn't bend you over and
stuff the One True Garbage Collector up your butt.
 
H

hardi.pertel

If you had asked me 5 years ago about the future of C++, I would have
told you that its future was assured for many years to come. Recently,
I have been starting to wonder.
.. snip ..
Please tell me I am wrong, and paint me a view of the future which
includes C++.

Imho .NET will finally fall, as the open-source will knock it down, but
..NET is making it's final breaths... You just need to wait
 
F

Frederick Gotham

blangela:
What has changed? I believe that students are
no longer interested in learning C++. They would rather learn .NET
languages or Java (my colleages who teach these courses seem to be very
busy!). I believe it is because these other languages are easier to
learn and/or are perceived to be more relevant today.


I think that a prerequisite to being a decent programmer is to have above
average intelligence. A minority of people have above average intelligence,
and so a minorty of people aspire to be an actual bonafide programmer
programming in languages such as C and C++.

For the less bright among us, there's Java.

Electronic Arts (if you have not heard of
them, I guarantee that your kids have -- they create video games) is
only one of several gaming companies here in Vancouver that employ
primarily C++ programmers.


Computer games should be fast, and C++ can give performance.

Not
surprisingly, I have talked to several companies here in Vancouver who
are complaining that they are having difficulty finding C++ developers
and are looking at trying to recruit from abroad (eastern Europe
primarily).


We've the same situation with medical doctors here in Ireland.
 
B

blangela

I see a fair amount of responses to my initial post, but very few
people willing to go out on a limb and predict the future of C++.
Perhaps we will just have to wait and see.

In response to those people who were critical of my C++ course (the
post was not meant to get opinions on my course) I will mention the
following facts:

- I use as my primary text "C++ - How To Program" 5th edition by
Deitel & Deitel which is by far the most popular college C++ text in
the world! My favorite C++ text is actually "C++ Primer" 4th edition
by Lippman and company, but it is difficult to use as an introductory
C++ text - I do reference several sections from the text in my courses.

- Students are supposed to have taken the Java BlueJ courses (2 - 12
week courses, 3 hours/week including labs) as a prerequisite to my C++
courses. Thus I can expect that they already have experience with OOP.

- Classes are introduced in the first lecture of my course. So also
is the string class. I do not introduce pointers until the 8th
lecture. I suspect the text does so at that point so we can start
working with dynamically created objects (using the new and delete
operators). I could show how to assign a dynamically created object to
a reference rather than to a pointer, but this might lead students to
think this is the norm, which in my experience is not the case (I
wonder why it is not done more often?).

Cheers,

Bob
 
E

E. Robert Tisdale

blangela said:
If you had asked me 5 years ago about the future of C++,
I would have told you that its future was assured for many years to come.
Recently, I have been starting to wonder.
[snip]
Please tell me I am wrong
and paint me a view of the future which includes C++.

The design of Java, C# and other such languages
sacrifice performance and efficiency for simplicity and convenience.
C++ is a larger and more difficult language because Bjarne Stroustrup
refused to compromise performance and efficiency --
he was targeting C programmers.

The Java designers realized that most applications didn't require
the performance and efficiency offered by C (and C++) and very carefully
calculated the trade-offs for simplicity and convenience.
The success of Java (and C#) have vindicated these trade-offs.

The future of C++ appears to be secure
where performance and efficiency count.
According to Bjarne Stroustrup, there are no viable competitors yet.
 
B

blangela

E. Robert Tisdale wrote:
..
..
..
The future of C++ appears to be secure
where performance and efficiency count.
According to Bjarne Stroustrup, there are no viable competitors yet.

But can there be C++ without C++ programmers?
 
G

Gianni Mariani

blangela wrote:
....
Please tell me I am wrong, and paint me a view of the future which
includes C++.

C++ is a very large language with many many uses. It will persist for a
considerable time.

The biggest advantage for Java is that they have many useful
standardized libraries as part of the standard distribution. C++ has a
plethora of non standard libraries that do vastly more than Java but it
takes a significant amount of knowledge to navigate.

Boost has been an attempt to consolidate the C++ world and there are others.

The nice thing about some of the stuff I have seen is that the number of
amazing libraries I see showing up in C++ land are significantly better
than the Java or .NET systems and are probably more "robust" than Java
or .NET.

I have also met a number of Java coders who have migrated over to C++
because they're frustrated with Java.

If I was teaching C++ today, I would avoid C-isms in the "101" course
and only introduce the ones that "helped".

I would have a wrapper over main ...


int main( const std::vector< std::string > & args )
{
std::cout << "Hello world\n";
return 0;
}
 
B

Bo Persson

blangela said:
E. Robert Tisdale wrote:
.
.
.

But can there be C++ without C++ programmers?

No, but there is a lot off difference between "go away" and not being the
most popular language at the moment.

Both Java and .NET have large companies behind them, using millions and
millions for promotion. Of course they are popular, "the best thing since
sliced bread".

Bjarne can never compete with that. Even though he is right!


Bo Persson
 
S

Steve Pope

Roland Pibinger said:
IMO, that's the main reason. C++ is unnecessarily and unproductively,
sometimes even ridiculously complex (see e.g.
http://www.bookpool.com/ct/98031). There has been no effort in the
last 10 or so years to make it easier and more accessible. Quite the
contrary, an influential group of people even tries to 'boost' C++ by
continuously introducing yet another level of complexity.

I don't think that C++ is too large and complex, yet, but
I do see possibly too much feature-creep via the standards process.
Standards activities tend to become spoiled by their own
success. Not to say that those involved aren't doing a
superb job, but standards work is very difficult (much more
difficult than development).

I have known of software managers to move away from C++
due to a concern it is getting too large and uncontrollable.

A better approach, I think, would be to use C++ but impose
some discipline as to what libraries are used (and perhaps even,
what (non-library) language features are routinely used, but
there I think the concern is smaller).

Steve
 
P

Phlip

Steve said:
I don't think that C++ is too large and complex, yet, but
I do see possibly too much feature-creep via the standards process.

Oh, totally, a new version once per decade is just blowing us all down.
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top