All the novelties introduced since 1999 into C++ and some stuff that made it into the 1999 standard have dramatically deteriorated C++.Rein Halbersma wrote:Have you actually use modern C++ (the 2011 Standard) with things like auto, lambda, shared_ptr etc? It is a totally new language and not at all difficult to program error-free.diep wrote: My conclusion is that C++ is a very usable language if you would strip it down back to the type of typical C++ code you saw start 90s.
I agree with you: with 90s style C++ it is very hard to generate productivity that is worth 60K a year. That is why C++11 is currently so actively being taught by Microsoft, Facebook and at BoostCon (did you watch those presentations?): because it makes programmers more productive.google still isn't hte average company there of course - here in europe no company for a team of coders would be willing to pay salaries above say 60k euro a person a year. So you simply won't be able to assemble a good C++ team EVER.
a) made it more complex
b) i have hard evidence of that the many features of C++ let students mess up more than in C.
I'll give one obvious example. One student project i had carried out, the students programmed a program in C++. One of the programmers actually had written C++ codes before and not little. So several years experience in programming, at least one of them.
After some months, their code crashed everywhere. Lots of communication from me to them and vice versa, they just didn't get it working. in the code i saw of course their bugs. they used templates whre they didn't need a t emplate at all.
Just because their C++ book says that templates are one of the 'advantages of C++ over C'.
Sure, if you know how to bugfree use them and if you have a spot where you can use 'em.
Then i talked to them and they agreed translate the code to C code.
That's what they did.
Within 2 days it ran without crashing.
Weeks of debugging from their side the C++ code didn't help, but just 2 days converting it to C and a bit of debugging got enough bugs out of it to find it acceptable.
That's the hard truth about C++.
I hope you realize that when i was at university and in functional languages professors were more optimistic about lambda type notations than the devil about hell. When i saw some years ago that C++ nowadays has that to i realized C++ had gone to the devil as a language.
With that concept i wrote a checkers program in a functional language called gofer.
As it was so slow, i also translated it to C language within a week and that was factor 10k faster.
then a PHD took 6 months time to study my small project in gofer, note that i avoided of course haskell notation as that is IMPERATIVE. I wanted it to be functional.
After this 6 months he managed to improve it by factor 2 in speed.
My C code checkers program, i spend then another day to and it was also a factor 2 faster ,resulting again in a speed difference of factor 10k.
Actually you could also compile the gofer to C (turbo C at the time).
That limited the factor 10k a bit, but it was a big effort to translate it from gofer to C and then compile it. That was about factor 60 slower.
All this are highly theoretical concepts that require a high IQ.
For guys in an university who have all time of the world it might challenge their mind to be capable in a language with high level concepts that THEY understand, but a company is there to make a profit.
I'll tell it even stronger to you. The aim of a company as defined in the definition of a company is that it is striving after profit.
So they want to make a profit, they are not charity organisations.
In short they want to get things done.
Now if in YOUR time you prefer to challenge your mind and toy with things that slow down your code, i suggest you do that.
But considering the tons of new features in C++ to *somehow* improve productivity, whereas by definition of what IQ is, we can prove that the new features demand a higher IQ, then your statement is of course far from the truth.
Truth is that in order to bugfree program being busy imperative is most effective and most simple way of getting things done.
So the more features you add to a language, regardless how enthusiastically a few nerds are about that, it won't improve the language from companies viewpoint.
From that viewpoint i fully understand that many companies standardized upon java and have simply kicked out or are replacing all their C++ codes by Java, as after all, nowadays most coding work is what was the factory worker of some decades ago.
Within all that coding work, the guru's fix the most complicated things, yet that shouldn't take care kicking out the average coder. He should be able to also find his way in the guru's code.
It's obvious that you don't care about all this. Feel free, we live in a society where having different thoughts is considered productive

If i would be a manager there, i would do exactly the same though, and kick out all the C++ codes and replace it by simplistic java codes made by highschool level coders. Cheaper and it works.
That said, they're also trying to increase difficulty of java and i'm not sure whether that's a rather good idea, yet i try to stay away from java as far as i can, as i won't get well paid contract jobs there.
As for programming low level, C++ can be used to do that, but it isn't easy.
Too many ways to slow you down. 99% of the C++ programmers will fall for one of those temptations.
The fact that most of the guru's make no chance in hell low level against a guy like me, whereas most of what i've been doing has focussed upon algorithms, should be a warning for you that there is something fundamental wrong with C++.
The idea of object orientation is just plain wrong for todays hardware, that's the underlying problem.
You can try to make 1 language that's object oriented and also have enough modifications to it, or have it that compatible that you also can have it function as an imperative language like C, yet it won't change the nature of the beast that object orientation is simply a concept that doesn't cast well onto todays hardware, not to mention GPU's where you have just 1-4 kilobytes of register data a streamcore and where you've got a very tiny instruction cache to feed all the streamcores the same code. At AMD gpu's you've got 8 kilobyte L1i, and at Nvidia a tad more but not that much more (you can chose there how to divide your L1), note you lose L1 then if you choose more instructions.
And the L2 isn't doing a great job to host instructions, unlike it is doing so great at todays cpu's.
So there is an increasing gap between object orientation and reality of hardware.
Note the same criticism of object orientation is for Java.
So for low level coding I stick to C for now
