By CodeJustin
via gigamonkeys.com
Published: Oct 17 2009 / 07:02
One of the topics I asked most of my Coders at Work interviewees about was C++. I am not an expert, or even a competent C++ programmer and recognize that my own opinions about C++ are not well-informed enough to be worth much.1 But C++ fascinates me—it’s obviously a hugely successful language: most “serious” desktop apps are still written in C++ despite the recent inroads made by Objective C on OS X and perhaps some C# on Windows; the core of Google’s search engine is written in C++; and C++ dominates the games industry. Yet C++ is also frequently reviled both by those who never use and by those who use it all the time.
That was certainly reflected in the responses I got from my Coders interviewees when I asked them about it. Jamie Zawinski, as I’ve discussed recently, fought tooth and nail to keep C++ out of the Netscape code base (and eventually lost). Some of that was due to the immaturity of C++ compilers and libraries at the time, circa 1994, but it seems also to have to do with his estimation of the language as a language:



Comments
yakkoh replied ago:
The usual stuff:
"...C++ forces programmers to subset the language"
"...C++ was pushed well beyond its complexity threshold"
"The syntax is terrible ..."
"I don’t like C++; it doesn’t feel right..."
Like most programmers, I suppose, I use a clean subset of C++, because C++ IS an improvement over C.
MCII replied ago:
The problem is C++ programmers don't agree about the "clean subset of C++" .
tony.ganchev replied ago:
What's the definition of "clean subset" ?
yakkoh replied ago:
It's more or less like a basic C++, with no surprises:
1) no multiple inheritance;
2) no operator overloading except perhaps operator=
3) no exceptions -- use a public function to check if everything is alright;
4) no initialization with the (); write everything with =
5) as little STL as possible, perhaps string;
With string you cannot construct with a predetermined size, even if you know that
the string will never grow. There is constructor but you have to supply a character.
6) no iostream -- I personally find it anti-natural;
7) no templates
8) no struct
9) always construct with new and a pointer like:
BoOkDescription *book = new BoOkDescription(); // this doesn't use the stack.
but
10) namespaces are okay.
It's C with classes.
tony.ganchev replied ago:
We can debate on the merits of everything up to point 10 but reaching point 1 I don't see if you have any need even for classes since you're not about to do oo or template-based programming therefore you don't need c++
agnus replied ago:
I find C++ fascinating too. Unlike most developers I know, who proudly vaunt for their C++ experience - most of which probably happened during college - and have long moved to Java/C#, I have been going the opposite direction. Started with scripting languages for a couple of years, then moved to Java for a good 7-8 years period and now slowly started experimenting with C++. Needless to say I am totally loving it.
tony.ganchev replied ago:
I don't feel forced to use only a subset of c++, nowadays compilers are standard-compliant enough - i support template-based code for gcc, vc++ and intel with no problems. I suppose there still are things I discover about it but this is what keeps it interesting. C++ is the only language today that is a potentially good solution for all software projects. The problem at present is the lack of a good web framework and ORM package but this is not due to a deficiency of the language.
Miloskov replied ago:
C is simple and straightforward for system programming. C++ It is a mess of a language it wants to be C but in a Frankenstein way. If I need something more high level I could use Java or C# for OOP or Haskell or Lisp for Functional. But really I like C better than C++.
Voters For This Link (16)
Voters Against This Link (1)