Advertisement
Scott Meyers, Adrei Alexandrescu, and Herb Sutter are not only top C++ experts but also very entertaining people. A must see next time they come to a panel discussion near you. Andrei the scientist, Scott the wise guru, and Herb the enthusiast shared some interesting insights. They were all worried (and righlty so) about the increasing complexity of the language. C++ is so difficult to parse that there are virtually no programming tools that require the analysis of a program. For instance, there is no decent C++ browser (don't even get me started on the MS VC++ browser). Teaching C++ is a nightmare. And, worst of all, people are being caught programming by trial and error (until it compiles). I'm afraid this is the fate of any language that is being designed by committee (the standarization committee). At this point C++ plays a very important role of a testbed for new features that hopefully in some near future will be implemented correctly in a completely new language. For now, we have to program in the language that even compilers cannot understand.
Anyone disagreeing with me? I'd like to hear your thoughts.
Anyone disagreeing with me? I'd like to hear your thoughts.
Advertisement
Advertisement
-
Questions for the future of C++
Tue, November 11, 2003 - 9:38 AMIs there a place for a langauge that takes 10 years to get good at? Do people need to start with a language that requires object lifespan management? As scripting languages get _good enough_ and computers get faster, are compiled languages headed for the scrap heap? Are we hanging on to the assembly language of the '90s? Are you sorry you asked for my thoughts yet? (grin)
Derek -
-
Re: Questions for the future of C++
Tue, November 11, 2003 - 3:03 PMI am of two minds towards C++. I think its complexity has reached the limit of manageability. Scripting languages are good enough for most tasks. The only niche for C++ is in large-scale software development. I am involved in the development of a version control system and I can't imagine using anything but C++. Yes, C++ is complex, but it also helps us hide the complexity of the system we are building. So far it's been working for us. But somebody out there should be thinking about a next-generation programming language with better abstracting capabilites and less intrinsic complexity. It doesn't matter if it's compiled or interpreted--preferably both.
-
-
Re: Future of C++
Wed, November 12, 2003 - 3:57 AM"Within C++, there is a much smaller and cleaner language struggling to get out," which Stroutstrup says "would ... have been an unimportant cult language."
In other words, Stroutstrup picked popularity over quality. Gee, thanks.
The language design priorities appear to be (1) backward compatibility, and (2) compiler optimization opportunities. The only major concession the language makes for mitigating complexity is static type checking.
Egotistical programmers can't resist the efficiency and complexity of C++. They boast about their clever optimization tricks and taunt job candidates with trick questions.
The C++ standarization committee is not entirely to blame. C++ was overly complicated and under-specified before the standarization work started. Some changes over the years have actually simplified it: runtime type information and the standard template library, to name two. Trying to add parametric polymorphism as an afterthought is a fool's errand. It's not surprising the template mechanism is so baroque nor that it took compiler writers so long to get it mostly working.
All that said, if you are armed with a good compiler, good debugger, and a bookshelf full of good C++ books, good coworkers, and you have plenty of time for all the gotchas, C++ can yield efficient code. Besides, usually you don't have a choice.
The important contribution of C++ is that it is enticing programmers to educate themselves about programming techniques and language features pioneered in all those "unimportant cult languages."
Seriousness aside, it's also preparing them for the incredible relief they'll experience when they eventually switch to a language that doesn't inspire such intense pissing contests. Whatever it turns out to be, it will have to compile much more efficiently than C++, have familar syntax, and hook up to everything. -
-
Re: Future of C++
Wed, November 12, 2003 - 6:02 PMYou wanna go to Pascal??? :) Sound like it fits your bill. We've got an ancient custom tool here written in Pascal that about once or twice a year we go an add a new feature to it. The executable is about 170K and compiles in the blink of an eye. But Pascal is a bit of a straightjacket which is why I wouldn't use it.
The problem with C++, not C, is that there are too many ways to shoot yourself in the foot, which is to say, write bloaty inefficient code or as you said, all the gotchas. I wouldn't dare say I was proficient at it unless I was in an interview. Most people who claim they are, really aren't. Their code has just never undergone real stress. At work we use hardware and software performance analyzers simply because no matter how good you are, you can't always see the bottlenecks of your classes by looking at your code or getting another book. This would be true no matter what language we used.
But I'm sure C++ will go through several more bastardized revisions before we find its replacement.
-
horid constructs
Wed, November 12, 2003 - 11:07 PMAh, but I learned to do evil things like:
return (m_signal && ((m_signal= false) || true) ;
from perl, but it just so happens to work in C/C++.
Then there's the classic:
swap1 ^= swap2 ^= swap1 ^= swap2 ;
You can shoot yourself in the foot, even when the gun is still in the holster. -
-
Re: horid constructs
Fri, January 9, 2004 - 3:24 PMHaven't you guys worked any place with coding standards bureaucracy? In my experience anything fancy like the previous post is banned, templates were discouraged as support on all platforms was not uniform until quite recently (and because they were thought to compile to bloated code), exceptions were ripped out because of the addition of one platform where the old compiler needed for other compatibility did not support them, streams were also discouraged, and a sparse style that seemed to break statements over as many lines as possible was mandated. The main usage of streams and templates was simply in legacy code that had come in from other companies and where it would have taken a significant planned effort to remove them.
-
-
-
Re: Future of C++
Thu, November 13, 2003 - 1:55 PMI looove C++ because everytime I program in it I learn something new. It is probably a bit too complex for the script kiddies and VB programmers nowadays but such is life - I have no idea about cobol. Having said that, alexandrescu won't be able to derive his generic programming techniques without combining the various aspects of C++'s flexibility, but this is a circular argument isn't it.
My ignorance now shines through - I kind of left programming and OO architechture a while back and haven't really kept up.
I had thought UML is the way to go? With Togethersoft (now borland?) Control Center one can usually map out a pretty good design. Of course, it's impossible to go from UML to C++ but I would have thought UML 2 Java would be pretty good by now. In the future there will be straight UML as a language I hope.