Stroustrup Says C++ Education Needs To Improve
simoniker writes "Over at Dr. Dobb's, C++ creator Bjarne Stroustrup has given an in-depth interview dealing with, among other things, the upcoming C++0x programming standard, as well as his views on the past and future of C++. He comments in particular on some of the difficulties in educating people on C++: 'In the early days of C++, I worried a lot about "not being able to teach teachers fast enough." I had reason to worry because much of the obvious poor use of C++ can be traced to fundamental misunderstandings among educators. I obviously failed to articulate my ideals and principles sufficiently.' Stroustrup also notes, 'Given that the problems are not restricted to C++, I'm not alone in that. As far as I can see, every large programming community suffers, so the problem is one of scale.' We've discussed Stroustrup's views on C++ in the past."
Dear Bjarne,
Your language is broken. It was broken very early on, but at least it could be described in 200 pages of densely printed text. Now it has grown to insane proportions in ever more elaborate attempts to add feature upon feature in an effort to satisfy every possible programmers syntactic fetish. Until it is at the point where anyone attempting to use the language spends more time trying to master the tool, rather than using the tool to create the end result.
Because of the absurd feature set, it has become nearly impossible to master the full breadth of the language. This manifests itself in the worst way when you have a group of coders each knowing different features of the language, with only a small subset that makes up the intersection of every coders C++ skill. The end result is that programmer A spends half his/her time trying to figure out what programmer B did with the language, rather than the what problem the code was trying to solve.
The most important thing to teach about C++ is how not to use it. By that I mean teachers should be telling their students, "This language has a 1000 features (or is it 5000 now I lost count), you should only learn about 100." The key is which 100. It is great for low level coding, an improvement over C if used judiciously. If used to construct complex object systems it is a horrible choice. Higher level dynamic languages are the way to go.
Bjarne if C++ is to continue to be used, you need to stop dumping more garbage into the putrid landfill that C++ has become. Instead it should be stopped in its tracks, and the programming community should restart a new C extension that takes some of the useful ideas of C++, simplifies them, and carefully limits any attempt to add features without any real value. In short do what you completely failed to do.
Oh and Bjarne your language deity status is here by revoked due to abuse of power.
For me it's typical "too little too less" syndrome. C++ played its important role years ago. Since then world has hanged dramatically. Current buzzowords dynamic languages, lambda expressions, clsoures and all this stuff and nobody cares if it makes sense or not. Sure - having known C or C++ it gives a lot advantages - You understand difference between heap, stack and pointers memory management - and gives You *real* understanding what, for example, closure is. But, on the other hand - who cares nowadays, except some really specialized areas like system development (actulally done in C), game development (partially) or HPC development (also partially). Actually nobody. That's said. Noody cares about C++0x or whatever it's named... Having 10+ years of core C++ development I actually even don't wanna read this spec. Word's going forward, languages going forward and nobody cares nowadays about unicodes support build in language or huge and convenient standard library (oh, maybe Ruby still do, last time I checked Ruby lacked unicode support also...). So far well C++ but don't expect people be excited now.
lima
I think that most poor use of C++ can be traced to the use of C++. C++ was about the fifth or sixth language I worked with professionally and without a doubt it was the biggest load of crap out I've ever had the misfortune to come across. Things like "friends" which enabled muppets on the project to complete subvert the principles of the project. The brain dead syntax (inherited from C like Java and C#) which values keystrokes over clarity. Unlike PHP or Perl where only the clinically insane would use them on a large scale (30+ developer) project C++ was habitually used on just that sort of development.
C++ education should be short and sharp....
If you want speed do C or assembler.
If you want OO do Eiffel or Smalltalk
If you want a job do C# or Java
Don't do C++.
An Eye for an Eye will make the whole world blind - Gandhi
I have been programming computers since 1976, and back then it was BASIC on a PDP-8e. Depending on your perspective, that either makes me experienced or a dinosaur. Keep your opinions, and enjoy them. Unless tragedy strikes, you too will hopefully gain some experience in life and be forced to listen to those who don't know 1/10th of what you do, and be forced to look back on your own behavior and wince about things you've said and thought to be right that were actually misinformed.
.net vs c++ arguments. With the [java | .net] proponents focusing on ambiguities in C++ or (gasp) pointers.
OK, "off my lawn" speech over.
IMHO everyone who complains about C++ is a pedantic fool. Nothing is perfect, no language, no computer, nothing. I loved what Stroustrup said in the article about becoming "language lawyers," rather than programmers. I am frequently amused about java vs c++ or
I come from a more renaissance period of computer science. Practitioners found it both necessary and valuable to know and understand "how" their programs actually worked. We needed to know how macros in the assembler worked. How addresses in labels got fixed up by the linker. How machine instruction permutations were constructed based on the assembler instructions. How to write an efficient "divide" function because the processor only added and subtracted. Forget floating point. Not to mention the mathematical efficiency of algorithms and so forth. Most of this stuff is black magic to most programmers today.
C++ has its flaws, absolutely. However, if you use "C" constructs, it is as efficient and as readable as C. If you conceptualize the logical constructs of your application as a hierarchy of objects, it can do that too. You can even easily and efficiently use assembler and pure C functions.
The root cause of bad C++ is bad C++ programmers. It is not COBOL and it will not protect you from doing something stupid. Just because you can do something syntactically correct, doesn't mean it is logically correct. A good rule of thumb to think about is this: If you don't understand how it will work, don't do it.
The argument that some features shouldn't be in C++ because of these problems sort of misses the point. A bicycle falls over without training wheels but is useless for serious riding with them. C++ without the features that can be misused would merely be a bicycle with training wheels.
Stop wanting everything to be "easier" to learn, some things become "easier" with learning.