No shit sherlock
Without any productivity enhancements, c++ will just keep losing its developer base.
So what’s all this about a new C++ standard, Verity? Why you asking me? I know nussing. I’m down to write ‘Porcine influenza — a programmer’s perspective’ this month. Don’t fib. Oh very well. The enthusiasts imprisoned in the ISO C++ bunker are reputedly on the point of lighting a white smoke bonfire to indicate they have a …
"Actually the C-plus-plusers point out it could be delayed until 200A, or indeed until 200F".
Since 200A is equivalent to 8202 in decimal, that means we could be in for a 6193 year wait.
If 3D Realms hadn't just gone belly up, I'm sure there'd be a joke in there about the new C++ being used to write Duke Nukem Forever.
"...complete with a wonderful square bracket syntax for deciding which bits of local state will arise from the undead when the thing is called..."
Interesting. The C# compiler just decides on its own, which occasionally leads to curious bugs with anonymous methods if you aren't wide awake.
I can actually see the point of &&, if I'm reading the joke right.. returning a complex object is a bit of a pain currently - you either have to copy or use pointers to some stored object. I presume it's intended as some kind of language analogy to a smart pointer, without having to write your own (everyone who's used C++ for a while probably has a smartpointer class somewhere).
The rest of the stuff is howlingly bad.. auto encourages lazy programming and would be a bug magnet (you can't even argue it for templates.. those should be typedefed). I can't even parse the curly brackets joke..
If anything, a new version of C++ should simplify it.. there's too much duplication where they decided to slightly change something that was already in C just to make it 'different'.
A while back I was working with a fellow who regarded himself as a total C++ guru. He would put try-catch around functions that didn't throw, and things like that. Now I see that C++ is doing its best to behave like a dynamically interpreted language. If you want to write in Perl, why not just do it?
Oh, and C++ still has to be fully compatible with K&R.
Verily I say, King Egg Fooey for Chip Stewards ...... and AI NEUKlearer Lead .... with the Full PerlyGatesPython Monty in Stealthy Cloud Cover, Verity?
Think of IT as an ESPecial Phormation of Special Post Modern Relationships and Light Years ahead of Hieroglyphics and Lost Covenant Arks.
Step into the Parlour, says the Spider to the Fly ..... "'Tis the prettiest little parlour
That ever you did spy."? :-) ...... http://ingeb.org/songs/thespide.html
Life is AIdDynamic Game, Full of Future Plans for Universal Players/Movers and Shakers.
Am I wierd? After using boost for a couple years and eliminating most of my OS dependencies between QNX, Linux and Windows I really began to appreciate the power C++ gives to library developers. Most of the complex constructs in C++ are only used where needed and then hidden away in a library or class so you can have neat and easy to understand code while still having powerful full control code under the hood. Besides Perl performs poorly for device drivers.
... K or R a few years ago, where it was said "Now that C++ has got away from us..."
He was IIRC talking about template metaprogramming vs 'just solve the programming problem at hand.'
I dunno about this stuff. Tempates are great if sometimes obscure. The STL is great, Boost is mostly great, but it's kinda like the sermon on the mount: I don't claim to understand all of it.
Some of the other stuff looks like angels dancing on the head of a pin. Trying to be all things to all people generally results in a big mess. KISS applies here.
int i = 0; // OK
int i = {}; // WTF? What obscure subtlety is this syntax addressing?
auto fn(int foo) { ... }; // Most C++ programmers *like* C++ strong typing. Why break it?
The right hand reference && thing (wrong name?) does make some sense though.
Editors: let's have a K or R or K'n'R icon!
So rather than removing all the half-arsed parts they thought they'd add some more, and not just silly academic additions, no, they'll be "Improving Standard C++ for the Physics Community".
I notice that members of the old crowd are still there: Francis Glassborow (remember him Verity?), Herb Sutter, P.J. Plauger. Seems like a cosy get together for old time's sake. One for road.
Concepts, or concept checking, explicate the implicit interface of templates. They are a way of ameliorating the problem of templates producing terrible error messages when used incorrectly. Prominent C++ pundit Scott Meyers, well known in the C++ community as the author of the "Effective C++" series, has questioned the necessity of concept checking in the new standard.
The whole point of supporting initialiser lists (the { } syntax) is to allow classes, particularly containers such as std::vector to be initalised like arrays. i.e.:
std::vector<int> container = { 5, 6, 7, 8};
This previously wasn't possible.
References aren't pointless. They are safer than pointers, in that they cannot be null, must be initialised, and their value cannot be changed once initialised - They become an "alternative name" for the value, as oppose to some distinct construct that points to the value. This facilitates operator overloading, and simplifies code. If it wasn't for references, you'd have to de-reference the pointer returned by the operator:
my_class a, b;
...
my_class c = *(a + b); // returns a pointer that is de-referenced - defeats the purpose of operator overloading
As against:
my_class c = a + b; // exploits user's intuition of what + ought to mean
C++ certainly has more than its fair share of warts, but can we please see an article written by someone that understands the rationale behind the introduction of C++0x's new features?
I have plenty of criticism I could make of C++ in general, and C++0x in particular, but I feel most of C++'s defects can be attributed to historical reasons, or the fact that major sub parts don't gel together flawlessly. It seems to me that often the shrillness of the criticism you hear of it posted anonymously on the internet is in direct inverse proportion to the poster's actual knowledge of the subject - typically, they make sweeping remarks like "C++ is shit", or "C++ is to C as lung cancer is to lung", whatever that means. Why is it shit? If it is shit, how do you account for the fact that many major projects have successfully been completed in C++, among them GoogleFS, Photoshop, Firefox and openoffice.org - are the organisations that created those project just stupid? What would you write, say, photoshop in if you were starting from scratch? I suspect that these people's needs ( I suspect that they're web application developers and Java/C# developers that produce middle of the road business apps) are not best addressed by C++ in any case, but perhaps if they tried a modern C++ framework like Qt or WxWidgets they'd find that many of the oft-repeated put-downs are overstated, outdated, or just false (example: C++ is the only language that combines higher level abstractions with manual memory management, which is bad. Ever hear of RAII, or for that matter Ada?). Some of these same criticisms can be made of C (most prominently, things about the inherent dangers of native code), but people don't criticise C because Unix is C and Unix is cool and I'm a hacker. The difference with C++ is that you don't have to use C's low level constructs like char pointers for strings, or printf statements - there's always a much better, safer alternative.
A common, and valid, criticism of C++ is that it poorly encapsulates compilation units, necessitating recompiling client code when a class's definition is changed. That's the price you pay for the speed of having true local variables on the stack - the size of the class must be known in advance of compilation. The greater point illustrated by this example is that, essentially, C++ addresses the needs of a large (though largely reticent) group of people with a particular set of requirements that want the particular set of trade-offs that are least bad to them. Could there be, in principle, a language that better addresses *their* needs or preferences? Definitely. Is there one? For most of them, no. The number of people using C++ is not currently in decline (it was a few years ago), it just isn't growing as fast as the user base of other languages (source: Bjarne Stroustrup's website).
Even to the initiated these features look like a bit of a hard sell. However, anyone put off by the enhancements isn't in the market for C++ in the first place, so that is probably as is should be. I don't see C++ losing it's 'expert only' status anytime soon (which is laughable if you can remember when there wasn't really much of an alternative).
Some things are just complicated and other things are needlessly complicate (COM programming in C anyone?), but if you want to get the most from your machine you have to go beyond the average.
What will be interesting will be to see what new compiled language eventually comes along to properly challenge C++ (Digital Mars D seems like the obvious one a the moment, but that has its own issues). That isn't likely to happen anytime soon I would say.
If the new C++ features have you reeling in horror, then gues what - it obviously isn't for you. Just like device driver or OS kernel programming isn't for everyone.
Fair comments. Yes, int i = {} is pretty bizzare I agree and I sympathise with 'angels dancing on the head of a pin' comment. I think it's undeniable that there are elements of this as C++ gets more sophisticated!
However, I think the auto keyword will be fine if it is implemented sensibly. The whole point is that you still have strong typing, but you no longer have to type an essay to define a complex type (and yes, I do religiously use typedef, but that is hardly the point).
At least the comments haven't degenerated into a total flame-fest yet!
As I read it, the article is intended to be humorous rather than a serious critique of C++. It's funny even for a C++ developer if you can momentarily detach yourself from understanding why these changes were made and what they achieve. But can we be spared the harsh replies? C++ is very good for specific purposes, as every other language is good in the right context. For those who understand and appreciate the language, these replies sound like email neophytes scoffing at the @ symbol in an address as if it were obvious to all how stupid it is.
Yeah, bring on the rants! Excellent!
As much as I agree, the problem is it's pointless trying to convert the 'it's too hard' crowd. They've already closed their minds to the whole conversation. The trouble is C++ take concepts from many other languages and fans of those other languages resent it.
Observe all the hate from C programmers and functional programmers alike.
As Bjarne himself stated, inside C++ is a smaller, cleaner language struggling to get out. With the new standard that struggle can only be harder I guess, but it certainly doesn't diminish the good work done in creating it.
As you obviously realise from your other comments, C++ will continue to flourish on its own merits - but this isn't 1993 and never will be (yes, I realise you also realise this!)
Regards
a decade+ ago I spent a week trying to get a tiny test prog (one or two hefty lines of STL) running using the early STL with metrowerks C++.
I lost. Broken compiler, broken STL. It put me off for life.
I can handle C++ and welcomed some of it but the tangled, obtuse, spiny and obstreperous mass of the language eats too deeply into my limited cognitive reservoir, which I prefer to keep for tackling the quite-sufficient complexities of app development.
The cost of using it is too high for me so, no ta if I can help it.
"Oh, and C++ still has to be fully compatible with K&R."
Rubbish. C++ has never ever been K&R compatible (whatever you mean by "compatible").
Even C does not need to adhere too closely to the original K&R spec. Lots of weird so-called "illegal" code compiles just fine and dandy. Depends on what you're trying to do. That's kinda the point, y'see?
it is designed to keep developers in jobs for as long as they like or for how long the money lasts.
All these features are valid for certain types of problems, and for problems people have yet to really define.
C++ is normally not the language to choose for any particular thing if you are responsible for the budget, but if you had to only use one environment for everything then C++ would be it.
"And you can make for loops in a style I last saw in CORAL 66, where one provides the list of values the loop variable takes."
MATLAB and R both do this. You pass in an array of whatever you like, and the language iterates over each element.
MATLAB style:
for i = [1 3 69 -7]
% something
end
R style:
for(i in c(1 3 69 -7))
{
# something
}
Check http://www.sappeur.eu. That is real innovation on top of C++:
-Safe as Java
-Trace Garbage, don't collect
-All pointers are Smart Pointers
-multithreading is made explicit in the Type System
-Array access is always checked
-Heap and Stack are safe
-References can (and should) be used
Save Energy and conserve Money - use SAPPEUR !
"...the auto keyword will be fine if it is implemented sensibly. The whole point is that you still have strong typing, but you no longer have to type an essay to define a complex type..."
I conclude I need to spend a bit more time understanding the auto keyword. It seemed to me it was sort of a 'variant', like in VB. Your comment contradicts this. Thanks.
The thing about C++ (and to a good degree C also) is that it is a very open ended language. So you can do all this wild stuff with it that Stroustrup maybe never dreamed of. The people you mention are IMHO people of good faith. In scientific computing FORTRAN has lost some ground to C++ - so adding complex numbers and such is a good idea.
What really convinced me C++ was worth learning and using was it's combination of flexibility and expressiveness and compactness (compared to most other languages at the time). That's what hooked me about C too.
But, hey, the ability of a language to express increasingly subtle things gives us arm-chair language designers something to talk about, eh? 90% or 95% of C++ programmers and C++ programs will not use the more esoteric new features. But where they are useful, nothing is wrong with having them.
My $0.02.
Someone pointed out above that the article was probably more a humour piece than a critique of the language. I agree.
Now, if you want to read something funny about a programming language, go find a copy of the Intercal programmer's guide. Suspend criticism and just read. You'll probably laugh your *ss off!