Live data from Hacker News

C++ in Coders at Work

gigamonkeys.com

21–30 of 174 posts

Re: C++ in Coders at Work

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

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

And while they're busy bitching and hating and pontificating, humble unknowns are getting things done and making the world a better place. C++ is to systems programming what PHP is to web programming: the loyal packhorse that the A-list wouldn't be seen dead on.

Re: C++ in Coders at Work

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

Operator overloading all by itself is a source of plenty of headaches, in combination with multiple inheritance you can spend a good bit of time trying to find out what something should do before you can begin to figure out what it actually does.

In most languages my preferred view in the debugger is the source code of the language, in C++ I almost always just looked at the assembly. It seemed the more 'clear' language :)

Lack of GC never bothered me much by the way, that's no different in C, and that's where I really learned how to code, so keeping an eye on memory leaks and the opposite, double frees is somehow a built-in feature (of the programmer, not the language).

Re: C++ in Coders at Work

#23
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…

I think C models how the computer works a lot more closely than C++ (and no one would argue that C isn't carrying water out in the engineering world even today). IMO C++'s issue is precisely that it layers all of these leaky abstractions on top of the strict procedural model of C.

For my money, developers are better off knowing two tools (c + some very high level language) rather than the spork which is C++.

Re: C++ in Coders at Work

#24
post #21

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.

Well, the 'everyone' he is talking about are some of the most respected people in the computer world, that should count for something. And while they're busy bitching and hating and pontificating, humble unknowns are getting things done and making the world a better place. C++ is to systems programming what PHP is to web programming: the loyal packhorse that the A-list wouldn't be seen dead on.

That is very true.

PHP, Python and perl are rarely seen at corporations that existed before the web came around. Their whole IT department is set up around a different kind of environment.

I think this is in part why the web is so disruptive, because it enables all these upstarts using very light and nimble stuff to challenge the big and established companies directly.

You can pretty much tell what is enterprise stuff and what is 'quick & dirty but does the job' by comparing hourly rates for programmers.

It also has everything to do with the length of time before someone can be productive in a new environment. If that length of time is very short then there is not a very high barrier, which tends to create a lot of 'wannabe' programmers in that language.

By raising the bar you only end up with people that are willing to invest a large amount of time in a platform, that tends to favour people that get paid for their work, which in turn is found mostly in enterprise locations.

Re: C++ in Coders at Work

#25
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…

I totally agree. C++ main strength lies in its "portable assembler" nature. However, C++ also is [quite a behemoth][1], while Lisp, Python and Haskell aren't so.

[1]: http://yosefk.com/c++fqa/

The answer then is obvious : we should change the hardware, so it is not C/C++ optimized, but Lisp/Python/Haskell optimized. Then, these languages are easier and more practical.

Re: C++ in Coders at Work

#26
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 accurately models how the computer actually works

i don't even know on what kind of hardware my java or python programs run. neither google (appengine) nor our IT apartment tell me.

so for most app developers "a computer" is not really something they work with. of course someone must write those abstractions (python, etc), and they do it in C/C++ :)

Re: C++ in Coders at Work

#27
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…

I think C models how the computer works a lot more closely than C++ (and no one would argue that C isn't carrying water out in the engineering world even today). IMO C++'s issue is precisely that it layers all of these leaky abstractions on top of the strict procedural model of C. For my money, developers are better off knowing two tools (c + some very high level language) rather than the spork which is C++.

I remember 'cfront', when it first came out, and to this day I haven't really changed my mind on how I felt about it, it's a much too bloated language compared to the elegance of C.

If 'C' would have had a decent native string type I think C++ might not have happened ;)

Re: C++ in Coders at Work

#28
post #19

Earlier quoted context omitted.

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…

Operator overloading all by itself is a source of plenty of headaches, in combination with multiple inheritance you can spend a good bit of time trying to find out what something should do before you can begin to figure out what it actually does. In most languages my preferred view in the debugger is the source code of the language, in C++ I almost always just looked at the assembly. It seemed the more 'clear' langua…

Is operator overloading in C++ really more complex than it should be, or did you just pay the inevitable price for dabbling in the black art of multiple inheritance? Anytime you say "in combination with multiple inheritance" you can't expect to get much sympathy ;-)

C++ is definitely a language where you can get screwed by "clever" programmers who would rather be reading TC++PL than actually coding, but it's not so bad if the people you work with exercise good judgment. I've never had to deal with multiple inheritance in real production code, for instance.

Re: C++ in Coders at Work

#29
"Yet C++ is also frequently reviled both by those who never use and by those who use it all the time."

I was once listening to RMS speak at a conference. One guy got up and said that this was one of the n great talks he had been to.He mentioned that Stroustrup as another speaker who had impressed him upon which RMS said "You need to get your head checked".

Sometimes a great hacker community can help overcome the shortcomings of a language. Trevor Blackwell makes that point here: http://www.tlb.org/faq.html.

"Besides their intrinsic characteristics, languages define commmunities of programmers. You want to choose one that lets you communicate with good programmers, because you'll learn from them. They tend to prefer powerful languages like Python, Lisp, and C++. So for example, although Visual Basic is actually a powerful and complete language, few good programmers use it. C++, on the other hand, is a rather poorly designed language, but for historical reasons a lot of smart people use it so at least you'll be in good company."

Re: C++ in Coders at Work

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

LLVM IR [1] is portable assembler. C is "portable" in the sense that:

a.) you get direct access to your linear address space

b.) gcc targets so many instruction sets that you don't have to worry about your backend unless you have a custom platform.

C++ is the thing that screams "__gxx_personality_v0" at me because I always start off using gcc instead of g++.

[1]: http://llvm.org/docs/LangRef.html

Post reply on HN