Linked by Thom Holwerda on Tue 1st Jun 2010 15:12 UTC
General Development "I am pleased to report that the GCC Steering Committee and the FSF have approved the use of C++ in GCC itself. Of course, there's no reason for us to use C++ features just because we can. The goal is a better compiler for users, not a C++ code base for its own sake. Before we start to actually use C++, we need to determine a set of coding standards that will apply to use of C++ within GCC."
Thread beginning with comment 427687
To view parent comment, click here.
To read all comments associated with this story, please click here.
Member since:

C++, and in particular the new 0x features will really open up a lot of ways to cleanup the code.

C++ 0x now has lambdas, and a std::function object that contain and pass them around, as well as functor objects or C-style function pointers.

C++ 0x now has a standard regex library.

C++ 0x adds a lot to the functional programming side (unfortunately no pattern matching, though similar contructs are easy enough to create), and functional programming has long been known for its prowess in parsing and compilers.

C++ 0x adds r-value references (move semantics) which reduce the use of intermediate temporary values a great deal (one of the main complaints against C++ performance is that temporaries were created silently in the background uneccesarily.)
C++ in general adds templates, which is certainly a better alternative to meta-programming than C-style macros.

It'll take awhile to be adopted, and they certainly shouldn't do so wontonly, but there are plenty of advantages to be had by moving to allow C++.

Honestly though, if you've not been keeping up with the new features of C++ 0x or never cared about C++ before, go check it out (wikipedia has a throurough, if shallow, treatise thats pretty well done) -- its nearly a whole new language.

Well, in my opinion, C++0x will add additional complexity to an already way too complex language, reducing the number of capable C++ programmers and compilers even further. But I hope I'm misunderstood.

Edited 2010-06-02 07:44 UTC

Reply Parent Score: 3

Ravyne Member since:

I'm with you in a lot of respects.

As a language which, at the same time, tries to be both object-oriented and a systems-language (setting aside the true multi-paradigm nature) there are unfortunately bound to be 'dark corners' where things are left unspecified.

Its also unfortunate that the syntax can be so unwieldy (Something closer to SPECS, at least as an option, would be very welcome IMO).

C++ is a complex language, certainly more "rules" are being added to satisfy C++ 0x, but many of the additions go a long way toward combating code complexity, and allowing code to be more concise yet more expressive (they seem to be learning a lot from functional languages, in spirit if not in implimentation).

'auto' eliminates a lot of redundant type specification, both inline and typedefs.

Lambdas and std::function eliminate the need for functor objects, and puts the code where it should be. (and is a decent substitute for the lack of local functions in C++).

The regex library means C++ users can largely standardize on the one library, rather than all the competing regex libraries that exist now.

C++ is definately a tough language to fully understand though -- and poorer coders only understand precisely the breadth and depth that they've needed to -- I've been at it for 6-7 years now, and actively study the new features, dark corners and pitfalls, but I'm only *just* approaching "expert" -- if I assume that there are at least two levels above expert: 'guru' those that can listen to your problem, then cite (or quote) the portion of the standard that explains it from memory, and "diety" those that shape the future of the language. At my level, I've got a pretty good intuition when things go wrong with the core language and familiar libraries and why it is they've done so, and in general I know when something smells fishy even if I've never dealt with a certain feature or aspect before.

Reply Parent Score: 2

Neolander Member since:

I can't discuss all of that, sadly, because in C++, after playing for 2 years, I'm currently at the "beginner++"/"amateur--" level.

This always puzzles me when compared to languages like C and Python, where I got to understand the general logic in a few months and master the thing in ~1 year. In C++, anytime I finally get to understand and use a new nifty feature, I discover ten other ones which I didn't know about before. And now, C++0x is going to add up even more features to that.

It's discouraging.

I start to think that I'm going to end up restricting myself to using a "C with classes, overloading, complex heritage, exceptions, streams, and templates" feature set, and ignore the full complexity of the STL which is unneeded for my current projects. But I'd find it sad to do so, because if all those features are here, they certainly have some use...

Edited 2010-06-02 19:42 UTC

Reply Parent Score: 2