Live data from Hacker News

C++ in Coders at Work

gigamonkeys.com

1–10 of 174 posts

Re: C++ in Coders at Work

#2
Have there been experiments with creating a pre-compiler that checked that you were using a subset of C++? What downsides would this have (other than longer compile time)?

Re: C++ in Coders at Work

#3
Argh. Not a very useful article. Start with an observation: "Everyone hates C++, and yet it is really widely used. That's odd." Next, 10 paragraphs of people hating on C++. End with: actually wait, no ending.

Re: C++ in Coders at Work

#5
Part of how C++ is successful is that it retains C compatibility, and C accurately models how the computer actually works (at least computers of the 70s and 80s, which is all we know how to program well). Lovely languages like lisp, python, haskell may be nicer to work with, but they do not model the underlying machine properly, and for so many problem domains that is just not acceptable. It's not just a performance question.

And then C++ implements several programming paradigms (object oriented, generic, etc) without compromising that machine model.

Plus Bjarne was truly correct when he said: "there are languages people complain about, and there are languages nobody uses."

Re: C++ in Coders at Work

#6
I think it's a very good article detailing the various flaws of C++; I particularly have problems with the complexity of the languages making it very difficult for compiler writers to generate usable error messages (not only true for gcc as mentioned in the article, but Microsofts C++ compiler generates many unusable error messages, too! [At least it did in 2004, never touched it again...])

Re: C++ in Coders at Work

#7
> Stroustrup campaigned for years and years and years, way beyond any sort of technical contributions he made to the language, to get it adopted and used. And he sort of ran all the standards committees with a whip and a chair.

> And he said “no” to no one.

And that is the core of the problem.

Re: C++ in Coders at Work

#8
post #2

Have there been experiments with creating a pre-compiler that checked that you were using a subset of C++? What downsides would this have (other than longer compile time)?

But which subset ?

When I program in C++ (and sometimes you have to) there are features that I'll avoid like the plague, once bitten, twice shy.

In fact, my subset of C++ was usually try to stay as close as you can to C and use C++ when you have to. That seemed to be a pretty safe route.

Most of my C++ stuff was using Borland C++ Builder or Microsoft visual C++, I'm happy to say I no longer have to support software for the windows platform, so no more C++ for me.

Re: C++ in Coders at Work

#9
This is a disappointingly flamey article: roughly 90% of the comments are from people who got a bad impression of C++ during the pre-standardization days (which were admittedly horrible, but long since past). Most of the rest are from people who just skipped straight to Java, or who are so young that they never had to learn C++ at all.

The comments that really drop my jaw are the people who seem to hold up Java as a "better" C++. Java is okay, but from its sketchy real-world performance, to its crappy generic programming support and poor ability to enforce such type-safety basics as const-correctness, I've never been impressed. Take the time to learn C++ for what it is, instead of "C with objects" and you'll find that it's far more elegant than the backlash would suggest.

I think that what most people really hate about C++ stems from the widespread use of legacy compilers that incorrectly implement the spec, or implement older versions of the spec. This problem exists for every programming language in the universe (e.g. Ruby 1.8.6 vs. Ruby 1.8.7 vs. Ruby 1.9), but since C++ is widely implemented by multiple vendors, the problem appears worse. If Python or Java were implemented by Microsoft and GNU and four other smaller companies, you'd see the same horrible compatibility problems with those languages, too.

Re: C++ in Coders at Work

#10
post #7

> Stroustrup campaigned for years and years and years, way beyond any sort of technical contributions he made to the language, to get it adopted and used. And he sort of ran all the standards committees with a whip and a chair. > And he said “no” to no one. And that is the core of the problem.

I see this claim made frequently, but Stroustrup talks about several features in Design & Evolution that were rejected. The committee requires implementations before accepting new features; they don't say "We like that idea" and include it without evidence that it's both possible and useful.
Post reply on HN