If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Approved: C++0x Will Be An International Standard

08-14-2011, 07:30 PM

Phoronix: Approved: C++0x Will Be An International Standard

The ISO has unanimously approved C++0x, the next version of C++, to become an international standard. The International Organization for Standardization will now prepare the standards document for C++0x and release it in the coming months...

Comment

C++ got to the point of no return. It's huge. People should move to D or something.

D is massively larger. I just need to point that out. Complaining about the size of C++ and then recommending D as an alternative makes as much sense as complaining about the fuel economy of old car and recommending a Hummer to replace it.

The C++ spec is a mere 1100 pages in a PDF last I checked -- that's nothing when you remember that it includes documentation on the machine/memory model, its complete standard library, various legalese and ISO comittee bits, is in gruelingly-specific details laid out in standardese wording and precision, and includes a very impressive set of (all immensely useful) features. The D language would be many, many times that size if it actually were properly documented (it is not) and if you included its standard library (which is so bad, they had to rewrite it. twice. and it's still a mess). Plus, D really doesn't actually do anything of note that C++ doesn't do; the few niceties it has and the slightly cleaner syntax don't make up for for its shortcomings, like needing to manually rebind any non-trivial C/C++ libraries you want to use (there's a reason nobody uses any of the plethora of other native languages out there), mandated garbage collection (which is a complete "hell no" to a large class of the things C++ is used for, including games), its bloated misdesigned standard library (less is more, especially when you're going to rewrite the standard library anyway for specialized frameworks... like game engines), or its single-vendor nature (they've already deprecated one version of D and left everyone stranded).

D was a nice attempt at a better C++. The best, even. It just screwed up the way that every last single other attempt at the same has screwed up: it failed to actually be a (very near to) pure superset of C. C++ has a very specific set of properties that make it so successful. One of those is being a C superset. Obviously a clean syntax is not one of those, but frankly syntax is not that important in the grand scheme of things. Being able to do exactly what I need to do is important. The things C++ most needs fixed are changes that will give the programmer more control, less of a "safety net," and which would only mean more features and a larger spec. It would certainly be possible to design an actually successful "better C++" language. This will likely not happen, though, because the potential gain is basically nothing more than "fix a few syntax warts" and that would have to compete with "not compatible with the large body of C++ code already out there." Just not worth it.

Comment

Plus, D really doesn't actually do anything of note that C++ doesn't do

I've got to disagree with you there; D adds quite a few useful things from much cleaner syntax (not critical, as you point out, but the easier code is to read the better from my point of view) to contracts to a slightly odd form of meta-programming (mixin statements), and lets not forget, built-in arrays and that are actually worth using for more than just basic operations. Contracts and class invariants are great debugging features, and something like array index checking which is done in debug mode is something I've wanted quite a few times in C++. (To be sure, some of these things are less important advanced programmers as for beginners, but C++ just gives less experienced programmers way too many possibilities to cause something completely unexpected — from crashes to output that just doesn't make sense — to happen in my experience.)

On the other hand, I agree with you that D doesn't quite cut it. The difficulties of using C++ and even C libraries is one of the biggies; some other significant limitations are garbage-collector only operation, no multiple inheritence (interfaces don't quite cut it as a replacement), limited operator overload support, and class destructors not guaranteed to be run (a trade-off to allow faster program exits, as I understand it).

Comment

- binary literals
- the way pointers syntax works (I'm saying the syntax for pointers sucks, pointers in itselve are very useful.

I'm not convinced binary literals are great - I'd use hex in all cases even if they were there. It's actually more readable to have things in hex. As for pointer syntax...well, that can be confusing (nullptr is a bit late, but helpful never the less), particularly with function pointers, but I don't think it's that bad.