Live data from Hacker News

C++ in Coders at Work

gigamonkeys.com

11–20 of 174 posts

Re: C++ in Coders at Work

#11
post #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.

Well, the 'everyone' he is talking about are some of the most respected people in the computer world, that should count for something.

Also, they make fairly specific criticisms, and they have a track record of being right about such things.

Java seems to be the C++ replacement of the future, with C# pulling the other way.

Re: C++ in Coders at Work

#12
post #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…

C is a portable assembler. Sometimes that's exactly what you want.

C++ is C, except that it doesn't completely suck for higher-level projects.

Re: C++ in Coders at Work

#13
post #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 f…

I just use gcc to compile the code. That way I know what subset I am using and the rest of the code is using.

Re: C++ in Coders at Work

#14
post #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…

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

I think this is very true, what it says literally is that popularity and attracting ire are correlated.

However, my interpretation is that the reason why this is true is that (1) all languages involve design trade-offs, (2) every trade-off pisses someone off for at least a moment, and (3) popularity attracts eyeballs, therefore more popular languages have more people pissed off.

I am not suggesting you say this, but I have heard the (strawman?) argument that it is possible to design a nice, pure language that is above reproach but that it can't be popular, and thus his quote expresses the thought that there is an inverse relationship between elegance and popularity. I don't think this is the case.

Re: C++ in Coders at Work

#15
post #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…

Siebel mentions this point, off-handedly, in covering Guy Steele's take, and yeah, I agree.

Re: C++ in Coders at Work

#16
post #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.

Well, the 'everyone' he is talking about are some of the most respected people in the computer world, that should count for something. Also, they make fairly specific criticisms, and they have a track record of being right about such things. Java seems to be the C++ replacement of the future, with C# pulling the other way.

"with C# pulling the other way"

Care to elaborate (I'm legitimately unsure what you mean, not being snarky)?

Re: C++ in Coders at Work

#17
post #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…

[deleted]

Re: C++ in Coders at Work

#18
post #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.

I think the main thrust of that argument has to do with trying to please too many people that were willing to put their support behind C++ if the language would support their pet construct.

Re: C++ in Coders at Work

#19
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.

And he said “no” to no one.

I don't really see this. Most of C++'s complexity emerges naturally from three things:

1. Lack of GC.

2. Direct support for user-defined types on the stack.

3. The desire to implement every feature as efficiently as the corresponding C idiom.

There actually aren't very many controversial features in C++: multiple inheritance, operator overloading, templates, and exception handling are the ones that come to mind. With the exception of multiple inheritance, none of these is particularly heinous. Implementing them under the three restrictions above is where things get complicated.

Re: C++ in Coders at Work

#20
post #16

Earlier quoted context omitted.

Well, the 'everyone' he is talking about are some of the most respected people in the computer world, that should count for something. Also, they make fairly specific criticisms, and they have a track record of being right about such things. Java seems to be the C++ replacement of the future, with C# pulling the other way.

"with C# pulling the other way" Care to elaborate (I'm legitimately unsure what you mean, not being snarky)?

I think that C# is an attempt at creating an alternative for enterprise level programming to Java, basically .net and C# are an answer to the whole Java ecosystem.

They're competing for the same space, so a business that wants to implement some functionality from scratch basically has these two solutions to choose from.

In the 'web' domain there are many many more choices, but for places like banks and such that were first dominated by COBOL, then reluctantly moved to C or C++, for the most part they are either looking at Java or C#.

Post reply on HN