473,789 Members | 2,732 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

The Future of C++ ?

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

Nov 18 '06
190 8192

"gn" <gn******@web.d ewrote in message
news:11******** **************@ k70g2000cwa.goo glegroups.com.. .
>
Kai-Uwe Bux schrieb:
>And in addition, it open new venues for programming.

I'd just like to say it again here. I think we are just at the
beginning to understand what is possible with the template concept.
I hope not. Sigh.

Yes, I believe templates are overused and cause a lot of "bad" programming.
Because, very few people know how to use templates judiciously and
sparingly. I guess that's because the STIL isn't very good at teaching good
template usage. Many view it as a mechanism as common as the 'for loop'.
I wouldn't teach anyone templates until they've programmed a few years.
(Just a tad facetious to make the point in that last sentence).

Tony
Nov 23 '06 #41

"Phlip" <ph******@yahoo .comwrote in message
news:K2******** *********@newss vr14.news.prodi gy.com...
gn wrote:
>Yes, you are absolutely right if you say that the template concept
could be realized with a much easier synthax.

I mean an easier syntax can eliminate the need for the entire concept of
generics. If everything is an object, including classes, then you can pass
a class name into a function: foo(MyClass). Then you declare the function
as foo(klass), and to get an object you use MyClass.new(). This provides
the entire Prototype Pattern, built-into the language.
Better to keep the syntax as ugly as possible to disuade usage of it as much
as
possible (IMO).

Tony
Nov 23 '06 #42
gn
Earl Purple schrieb:
No I will tell you a problem I have had that is not a problem in Java.

I have an application that has to link with a 3rd party library, and
this 3rd party produces binaries for C++ in the form of shared object
libraries or DLLs. For Java they produce .jar files.

Now their .jar files work anywhere. The shared objects and DLLs do not,
so they have to build for each platform.

If that's not enough, their build for Solaris requires your own client
code ...

Even if everyone builds for GNU only (unlikely to happen) it still
means that you might have a problem keeping up with the versions.
Well - The problem here is that there is one java against many
different C++ compilers. Normally one should think that if you are
programming C++ conform to the standard (and of course capsulating (I
still don't know the right word here in english) system functions) your
programs should compile at every platform where you have a C++
compiler. In reality thats not the case because many compilers are not
conform with the standard, especially concerning templates.
Additionally people who are using things like visual C++ or Borland C++
Builder are often not aware of using non standard libraries. You are
also right with the different GNU versions where I had some problems
with my template syntax.
But all this is not a problem of C++, but of the compiler developers
(let's see what the next standard brings and how fast they are in
implementing it to all compilers). There are also many other things
that I am missing in current compilers (e.g. return value optimization
for recursive functions). I really think that C++ will become much
faster in the future because there are many such things to optimize
that is to complicated for todays compilers.

In the end everything depends on the specific tasks. For my field of
work (computational chemistry) it's simply no question to use anythingh
else than C++ or Fortran, because those quantum chemical calculations
are still to slow even on huge clusters and even for small molecules. I
also think for bigger projects in the software companies it should be
no problem to have C++ and java programmers working on the same
project. It's no problem if you have a good design.

Best regards,
gn

Nov 23 '06 #43
gn

Tony schrieb:
"gn" <gn******@web.d ewrote in message
news:11******** **************@ k70g2000cwa.goo glegroups.com.. .

Kai-Uwe Bux schrieb:
And in addition, it open new venues for programming.
I'd just like to say it again here. I think we are just at the
beginning to understand what is possible with the template concept.

I hope not. Sigh.

Yes, I believe templates are overused and cause a lot of "bad" programming.
Because, very few people know how to use templates judiciously and
sparingly. I guess that's because the STIL isn't very good at teaching good
template usage. Many view it as a mechanism as common as the 'for loop'.
I wouldn't teach anyone templates until they've programmed a few years.
(Just a tad facetious to make the point in that last sentence).
Ok - perhaps I don't have the right to talk about this because I'm
definitly no expert on programming and relativly new to C++. But in my
projects the template part is perhaps 0.5%. I'm only using them for
speed critical parts as libraries for matrix calculations and for those
parts I'm spending much more time than for other parts in planning and
implementing it, to be sure that it really works in an optimal way. So
I really don't think I'm overusing this concept. Of course, if you also
count the usage of the STL then I am overusing it.

Best regards,
gn

Nov 23 '06 #44
Actually the C library we have to link against has no such issues. We
can link against that with any C++ code we like. If they provided a C++
wrapper it would mean we didn't have to write our own but at least we
didn't have the same issues.

One solution would be a standard C++ runtime library (per machine), so
that vendors can write C++ libraries which would simply link against
the standard C++ runtime library installed on the system, the same way
that C code links against the native C runtime library.

On UNIX machines this should include any POSIX extensions (which were
often in the headers like <time.hand are now in <ctime>).

Standard name-mangling (per platform) would also help.

Nov 24 '06 #45

Kai-Uwe Bux skrev:
[snip]
Don't get me wrong. I have oftentimes missed being able to do

void f ( type A ) {
A a;
...
}

and I would welcome an extension of C++ in this direction
Am I the only one failing to see whats wrong with

template<typena me A>
void f() {
A a;
...
}

What problems does the above function have which your solution solves?

/Peter

Nov 24 '06 #46
gn
peter koch schrieb:
Kai-Uwe Bux skrev:
[snip]
Don't get me wrong. I have oftentimes missed being able to do

void f ( type A ) {
A a;
...
}

and I would welcome an extension of C++ in this direction

Am I the only one failing to see whats wrong with

template<typena me A>
void f() {
A a;
...
}

What problems does the above function have which your solution solves?
There is no problem with the above function!
But for constructs like:

template<templa te<class foo1class foo2>
class foo3 : public foo2<inst1>
{...};

and more complicated expressions I'd really like to have a more
readable syntax. In fact I have no good idea how to simplify this in
the best way.

Best regards,
gn

Nov 24 '06 #47
Tony wrote:
Yes, I believe templates are overused and cause a lot of "bad" programming.
Because, very few people know how to use templates judiciously and
sparingly. I guess that's because the STIL isn't very good at teaching good
template usage. Many view it as a mechanism as common as the 'for loop'.
I wouldn't teach anyone templates until they've programmed a few years.
(Just a tad facetious to make the point in that last sentence).

Tony
I believe that developers are using templates too few.

The book I suggest to C++ beginners is Accelerated C++. I didn't
actually read it because by the time I found out about it I didn't need
it anymore. But I had a quick look through it to evaluate whether it's
good for my less experienced [ex]colleagues. And I think that Bob
Langelaan could use it to improve the course too, following the
suggestion of Alf P. Steinbach to start with standard library classes.

One of the more remarkable facts about the book is that template
functions are introduced in chapter 8 while classes are left for the
chapter 9. I think it's not because they are more important than
classes, but rather because they are easier to learn and they can
simplify your code.

In your OOP orientation you fail to see that you often need helper
functions to simplify the code and improve its readability. Otherwise
you end up with the classic spaghetti code. If these functions do not
use the object's data, making them private member functions seems
wrong to me as this exposes the class's implementation details to the
user of the class and introduces unwanted dependencies. (And the Pimpl
idiom is not suitable for all situations.)

Template functions have the additional advantage of avoiding the
copy-paste bugs and reducing the amount of code in general.
Less code means less opportunities to make bugs, doesn't it?
And template classes are even better in this regard, you don't
need to rewrite std::vector for each type you use it with. And
that's just the beginning.

Bluntly put, if you avoid using templates, you avoid one of the best
features of C++. You can work around that to some degree using
inheritance and virtual function overriding, but this introduces
unwanted dependencies, some (usually unimportant) performance
hit and you also lose some advantages of the static typing in the
process.

Regards,
Vladimir Marko

Nov 25 '06 #48
Earl Purple wrote:
Bo Persson wrote:
>>
So you are telling us that Sun's Java works better than Sun's C++?
:-)

And that that is a language problem?

So you're suggesting that Solaris are refusing to change their C++
to be compliant by default to push more people into Java? Wouldn't
put it past them.
I suggest that Sun puts a lot more effort into their Java implementation
than into their C++.

At the same time, they seem to have to resort to using an amazing amount of
C++ code in their HotSpot VM.

https://openjdk.dev.java.net/

Wonder why? How do they manage to port that to new machines?
Bo Persson
Nov 25 '06 #49

blangela wrote:
I have been teaching C++ at a local polytechnical school here in
Vancouver, Canada for approximately 8 years.
I think it is important to note that because a C++ course is becoming
smaller in Vancouver, Canada does not mean that the C++ language as a
whole is dying. Who knows, it could be that the University has less
students as a whole. Also, this is an introductory course so people
may be taking other languages to start out and then moving up to C++
later.

Nov 26 '06 #50

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

47
3668
by: David Eng | last post by:
> For many years now enterprise business application development has > been the core area for the use of C++. > Today a significant share to this segment has already been lost to > SUN's Java technology and with MS now abandoning C++ in favour if its > proprietery .NET and C# technology, how long can we except C++ to hold > on against these might competitors? > Has C++ become a dying language? > What is the future of C++? As I posted...
35
3360
by: GTO | last post by:
I do not believe that C# is the future of C++. I also do not believe that adding two thousand new library functions to the standard library is the future of C++. But what is the future of C++? Is it as good as a programming language can get? Like so many of you, I programmed speech recognizers, image recognition systems, a portion of a chess program, lots of numeric code using STL, and tons of other applications in C++, (even firmware...
9
2369
by: Lyle Fairfield | last post by:
It's confusing. Many people here and elsewhere make many different predictions: There's an introduction mentioning some aspects of this at http://msdn.microsoft.com/data/mdac/techinfo/default.aspx? pull=/library/en-us/dnmdac/html/data_mdacroadmap.asp revised Sep 2005 (upper case conversions are mine)
2
2169
by: | last post by:
Everything seems to be moving to .NET and VC++ seems to be adding a lot of managed code support every new release. The questions: is unmanaged code in VC++ beeing phased out in favour of managed code? And suppose I still program in VC++ 6.0, can I safely assume that the code I use in VC++ 6.0 will still be available in future VC++ versions. Finally will VC++ 6.0 generated executables be still be able to run on futur Windows versions and...
0
1856
by: Fuzzyman | last post by:
Hello all, The following is a copy of a blog entry. It's asking a question about future statements and the built in compile function. I'd appreciate any pointers or comments about possible approaches. `Movable Python <http://www.voidspace.org.uk/python/movpy/>`_ supports running both Python scripts and ``.pyc`` bytecode files. It does this by compiling scripts to bytecode, or extracting the code object from bytecode files, and then...
29
3134
by: Zootal | last post by:
My apologies if this gets asked/discussed a lot. With c# rampaging through corporate USA (and other countries), what impact will this have on the usage and future of c++? I've used both of them a bit. I'm in school, and our CS program does not use c#, but uses mostly c++ and a bit of java. C# is relegated ot the CIS programs. Out there in the real world, what kind of a future does c++ have?
6
14454
by: rohayre | last post by:
Im a long time java developer and actually have never done anything with java scripting. I'd like to write a short simple script for calculating a date in the future based on today's date and a letter. Can I use javascripting to create a webpage to allow a user to enter a letter and then click a button to find a future calendar date? I'm just not sure how much user interaction scripting allows. Does java scripting allow buttons, textfields...
5
3594
by: KimmoA | last post by:
Does C have a future? I'd like to think so, but nobody seems to agree with me. Of course, I don't use C in my profession, and maybe I wouldn't be using it if I had the pressure to actually produce things with deadlines and stuff. Hmm. That's a depressing thought. I can't stand OOP. Yes, it is beautiful in theory, and it might make sense for huge projects with many people involved, but I don't want anything to do with it. (I switched to C...
51
3437
by: Jon Harrop | last post by:
If Microsoft turn F# into a product and place it alongside C# and VB, will many people migrate from C# to F#? -- Dr Jon D Harrop, Flying Frog Consultancy http://www.ffconsultancy.com/products/?u
0
9666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9511
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10410
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10139
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9020
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5418
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3701
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.