C++ to catch up?
Jonathan M Davis
jmdavisProg at gmx.com
Mon Nov 5 10:20:13 PST 2012
On Monday, November 05, 2012 11:00:27 jdrewsen wrote:
> It seems like the C++ committee is speeding up development adding
> lots of the goodies from D like Ranges, static if, template
> contraints etc.
>
> Will D still have a case when C++ gets this done?
>
> I wonder if Andrei is part of the C++ Ranges Study Group?
>
> The Future of C++:
> http://channel9.msdn.com/Events/Build/2012/2-005
The closer that C++ gets to D, the less interested that many people will be in
adopting it, particularly because of the large user base and the large amount
of code out there that already uses C++. Programmers have to be convinced to
move to D, and for many C++ programmers, the improvements to C++11 are enough
to make a move to D not worth it, even if D is a better language.
But C++ will never have all that D does. There are too many things that it
would have to fundamentally change (e.g. how arrays work) which it can't
change, because it would break backwards compatibility. Many of C++'s flaws
stem from retaining backwards compatibility with C, and they're not going to
break that now either. So, while they can do a lot to improve C++, there's a
definite limit to it. D will ultimately have similar problems, since we'll have
to maintain backwards compatibility for the same reasons that every other
mainstream language does, but it's definitely ahead of C++ in that regard,
because it was able to learn from C++'s mistakes. And if we ever create a D3,
and we're willing to actually break compatibility with that version change
(which C++ will never do in any real way with any version change), then we can
avoid C++'s fate in that regard to at least some extent, but then you get into
a situation like python 2 and python 3 or perl 5 and perl 6.
In any case, it's pretty much a given that improving C++ will mean that fewer
people will move away from it to other languages, but it's also a given that
there are fundamental problems with C++ that can't be fixed, and in that
regard, D will always come out ahead of it.
- Jonathan M Davis
More information about the Digitalmars-d
mailing list