473,789 Members | 2,707 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
Tony wrote:
Now there's something interesting. Would you please expound a bit on
that and offer up the languages you had in mind?
See my other post - use one method to pass arguments to functions, not two.
Some arguments are classes.
And I thought it was invented so that application programs could be
delivered
on demand via a web browser! Silly me.
That's the only reason it became popular and got notice. The reason everyone
tries to use it for "enterprise " stuff is the "management by magazine"
effect; defeating the specter of C++'s bugs.

And it doesn't seem dominant in the

--
Phlip
http://www.greencheese.us/ZeekLand <-- NOT a blog!!!
Nov 23 '06 #31
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.

That's a little better than having two different systems to pass arguments
into functions: template<typena me aClassint foo(Object & anObject).

That is redundancy and cruft. Why can't we just write int foo(typename
aClass, Object & anObject)?
But that kind of
programming can only be done by a language using a real compiler (the
thing with templates is to be generic without loosing speed --
therefore the costs of being generic are shifted to compile time). So I
would agree that a language providing these powers with an easier
synthax might be the language of the future.
We allow our compilers to have an easy time of optimizing because we
over-specify everything, so all static types resolve at compile time. Yet
this is nothing but coddling our compiler. A more powerful compiler wouldn't
need it, and 'template' may someday just get in the way, the same as
'register' just gets in the way now.
But the other languages discussed here were java and .net languages
which can principly not provide this feature.
That's because some people want to compare C++ to other languages and the
first thing they think of is Java and its derivatives. Java may be the
competition with respect to business, but it's not the competition with
respect to technology.
I am just interested -- do you have a special language in mind, that
also maybe a candidate for future standards?
Uh, Python, Ruby, and Smalltalk?

(I think Smalltalk is the language of the future, and it always will be!)
Actually I am not using normal arrays very often. Real C++ is a very
safe language if you have a good design. If I make a mistake I am
realizing it instantly. Things like memory leaks are not possible if
you follow some simple rules. (In had them more often in python than in
C++).
Right. But every programmers' boss you will ever meet has bad memories of
losing millions of dollars, and programmers blaming crufty C++ code that's
full of memory-corrupting bugs. That's where the Java marketing machine
starts. (And .NET is nothing but a clone.)

--
Phlip
http://www.greencheese.us/ZeekLand <-- NOT a blog!!!
Nov 23 '06 #32
Phlip wrote:
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.

That's a little better than having two different systems to pass arguments
into functions: template<typena me aClassint foo(Object & anObject).

That is redundancy and cruft. Why can't we just write int foo(typename
aClass, Object & anObject)?
I take it that you then have template-classes take a type object as a
parameter during construction?

How would you mimmick partial specialization?
Best

Kai-Uwe Bux
Nov 23 '06 #33
Kai-Uwe Bux wrote:
How would you mimmick partial specialization?
The point: You just don't need to.

Partial specialization fixes a symptom, not the root cause...

--
Phlip
http://www.greencheese.us/ZeekLand <-- NOT a blog!!!
Nov 23 '06 #34
Phlip wrote:
Kai-Uwe Bux wrote:
>How would you mimmick partial specialization?

The point: You just don't need to.
I don't buy that.
Partial specialization fixes a symptom, not the root cause...
And in addition, it open new venues for programming.

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 (although
overloading the dot operator should have priority). However, such an
extension would be by and large unrelated to the C++ template mechanism and
by no means a substitute. There are areas where both methods could compete,
but not every use of templates is of that type.
Best

Kai-Uwe Bux

Nov 23 '06 #35
gn
Phlip schrieb:
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.
So far -- yes.
But again --- Each type of language may have a easy syntax providing
the ability to be generic, but the point is to be generic without
loosing speed and that is only possible with a compiler language not
with interpreters or just in time compilers. Of course there are
examples where templates are just used to compensate the insufficiency
of C++. First a popular example for that. For vectors a,b,c,d you may
write: a = b + c + d
The main reason why e.g. Fortran is faster on that than C++ (without
templates) is that Fortran is just summing up the vector components and
assigns them to a. In contrast C++ creates an object for c+d and then
adds the components of this temporary object to b leading to a new
temporary object whose components are assigned to a. Using templates it
is possible to get the same behavior for C++ as in Fortran and in fact
to get the same speed (there are publications on that). So this is as I
said an example where templates are used to cure insufficiencies of
C++, but thats not always the case. Also a simple example for that: In
my daily work I am often using a class for n-dimensional grids (with
variable size for each dimension), where I need several different
iterator-classes e.g. for iterating over a specific grid-shell. Of
course there are mathematical rules to calculate the step the iterator
must take from one grid-point to the next one depending on the number
of dimensions and the size of each dimension. But these values (the
step-size) are calculated at compile time giving an advantage in speed
that could not be realized by an interpreter. You can't build in
specializations for such specific tasks into a language.

I am just interested -- do you have a special language in mind, that
also maybe a candidate for future standards?

Uh, Python, Ruby, and Smalltalk?

(I think Smalltalk is the language of the future, and it always will be!)
Smalltalk is something I definitly have to try out (I never had a look
on a smalltalk program until now.).
But Python is something I am really used with (I have heard that they
solved the huge bugs in the garbage collection for version 2.5 -- is
this right?). But I encountered the frontiers of python very early that
forced me to switch to C++ (today I am very happy that I have
switched). I still think it's a nice language to do little tasks if you
have not much time. In fact it doesn't take a week to learn Python -
that's a feature. Of course for me it is now principly unsufficient,
because I am doing scientific programming and there speed matters. My
programs that I ported from Python to C++ are faster by a factor
between 160 and 220. So for me it's just a 2 days calculation what
needs one year in python.

Best regards,
gn

Nov 23 '06 #36
gn

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.
"Modern C++ Design" broadened my horizon concerning this topic :)

Best regards,
gn

Nov 23 '06 #37

E. Robert Tisdale wrote:
>
The first big problem with Java and .NET is that
they are not publicly owned standards like C++.
The language definitions can (and do) change without notiece.
This usually isn't a problem because the typical application
written in Java (or the Microsoft equivalent) has a very short life.
Not necessarily.

And most applications written in C++ more than 5 years ago look very
dated. Especially anything written pre-1998.
A better question is, "What is the future of Java?"
Computer programming languages tend to become more complex
in order to deal with ever more complex applications.
Eventually, Java may be as complex as C++
and the advantages will disappear.
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 to be compiled with the Sun Solaris compiler. Which is a problem
because it's non-standard - certain amounts of my code failed to
compile due to their disabling of template member functions in STL, a
major problem with std::pair's constructors for one thing. I had to
replace a (probably more efficient) vector.insert() with a std::copy
using back_inserter. (vector.insert is far more likely to optimise).

Then of course I need slightly different makefiles when we finally port
this to Linux where I will be using gnu compiler because that's the
standard there.

Even if everyone builds for GNU only (unlikely to happen) it still
means that you might have a problem keeping up with the versions.

Nov 23 '06 #38
Earl Purple wrote:
>
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 to be compiled with the Sun Solaris compiler. Which is
a problem because it's non-standard - certain amounts of my code
failed to compile due to their disabling of template member
functions in STL, a major problem with std::pair's constructors for
one thing. I had to replace a (probably more efficient)
vector.insert() with a std::copy using back_inserter.
(vector.insert is far more likely to optimise).
So you are telling us that Sun's Java works better than Sun's C++? :-)

And that that is a language problem?
Bo Persson
Nov 23 '06 #39

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.

It's the issue that library vendors only need to make one build of a
..jar and it runs anywhere that has a VM.

Anyway, where I work, which is actually a fairly big company that
you've probably heard of, most of the development has switched from C++
to Java over the last few years, particularly servers, and with the
issues I have had I can clearly see why.

Nov 23 '06 #40

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...
0
10200
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
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
9984
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
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
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4093
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.