According
to Hoyle...
C++0x
Part 6: Final Thoughts
macCompanion
March 2010
by
Jonathan Hoyle
jonhoyle@mac.com
http://www.jonhoyle.com
This month we
conclude
our series on the upcoming changes in the C++ language (known as
C++0x). For those who have missed the previous installments,
feel free to visit these links:
• C++0x
Part 1: What is It (and Does It Even Matter)?
• C++0x
Part 2: A Step Forward
• C++0x
Part 3: Making Coding Easier
• C++0x
Part 4: Smart Pointers
• C++0x
Part 5: Rvalue References
In these previous articles, we have discussed some of the technical
details for these changes and some of the pros and cons for
them. This month, I want to focus on where the C++0x draft
currently stands, and what it means for the future of C++.
Where We Are Now
The original ANSI C++ specification was ratified in 1998, although the
1997 draft was fairly complete. Even before that however,
most C++ compiler vendors were continually trying to keep up with the
latest versions of the specification draft, marketing their compliance
with the draft as it stood. You may recall that Metrowerks
CodeWarrior at the time was
being released four times a year,
with C++
improvements each quarter. Despite Microsoft's penchant for
dismissing industry standards, even Visual
C++ continued to be improved
during this period. When the spec went final, most vendors -
and consumers - were already for it. (Although scandalously,
it took Microsoft until Visual
Studio 2005 before their C++
tools were
finally ANSI/ISO compliant.)
Even the last minute surprising inclusion of the Standard
Template
Library (STL) did not hold up
for long the final ratification of
the
standard.
Fast forward 10 years, and it is the rare software developer who has
even heard that there is a new specification in the making.
The C++0x initiative began in 2003, being named such since it was
unknown when in 200x this new standard would be finalized (presuming
C++09 being the worst case scenario). Well, here we are in
early 2010, and even with the most optimistic of assumptions, we will
not see it ratified prior to the end of 2011 (more likely 2012 or 2013).
What Happened ???
I think that the ISO committee has been affected too much by both feature
creep as well as scope
creep. In attempting
to keep C++ comparable with newer
languages, the committee has entertained a number of changes that are
just not appropriate for C++.
And even with features that are theoretically good ideas, some of the
implementations (designed by committee) were just syntactically
awful. Case in Point: Concepts.
The idea with C++
Concepts is to help limit the range of types in a template class (a
laudable goal for simplification). This would be
great. However, I found the syntax that was proposed simply
awful. It was verbose and clunky, and I can't imagine anyone
really using it. At the Frankfurt meeting of the standards
committee last July, Concepts was finally dropped from C++0x (to which
I said "Thank God!").
The only "big" feature that (in my opinion) should have been tackled by
the C++0x committee was Garbage
Collection, as this is sorely
lacking
in C++, and found in all of the newer languages. C++'s defect
in not having it has been one of the chief reasons that software
developers have jumped to other languages, such as C# and
Java. Microsoft has incorporated Garbage Collection in its
own C++ language variant called C++/CLI
(although
did so in
its usually clumsy way). I had hoped that the ISO committee
could have done a better job, but they instead dropped it.
Sigh.
And as the committee spins its wheels, delays just keep
pushing out the ratification date. When I first wrote about
C++0x in a column
three years ago, the committee
timeline was
expected to have the draft completed by the end of 2007, the general
review in 2008, and ratification in 2009. Today, the timeline
reads the same way with the dates moved up exactly three
years: the draft completed by the end of 2010, the general
review in 2011, and ratification in 2012. And there's no
guarantee that this won't slip yet another year.
For additional information, an online
presentation of C++0x written in
mid-2007 is available to view, although some of the information
contained therein is no longer operative (such as the timeline and the
inclusion of Concepts).
Conclusion
The obvious question remains: What value is there in updating C++ in
today's world? After all, Apple is pushing its developers
onto Objective-C whilst Microsoft is pushing theirs to C#.
Aside from the Unix/Linux community (and many of them are either old C
programmers, or skipped C++ completely and jumped to Java), is it even
useful to have a new C++ specification? Well yes, it is very
useful. Despite the missed opportunities of Garbage
Collecting, an updated specification is needed to keep C++ fresh and
alive today, moving into the new decade of the 2010's. The
changes in the language will make C++ both easier and more powerful
than it ever was before. Longtime C++ developers may not
universally embrace every change coming down the pike, but they will
certainly take advantage of some of them, even most of them.
It now remains to the ISO C++0x committee members to buckle down and
focus at the task at hand to deliver this much needed update.
http://www.maccompanion.com/macc/archives/March2010/Columns/AccordingtoHoyle.htm