Live data from Hacker News

Zed Shaw on C++

librelist.com

71–80 of 210 posts

Re: Zed Shaw on C++

#71
post #56

Earlier quoted context omitted.

For some concrete examples of the above: WebKit, Chromium, Gecko, and V8 are all C++. My impression is that there is a very high startup cost with C++ to getting it working on the platforms you want to support and picking the subset that isn't going to screw you. Once you get over the hurdle, the improved memory management (I agree with the post Zed is ranting in response to) starts to pay dividends.

V8 is hardly a ringing endorsement for C++. Just sayin.

V8 is ringing endorsement for V8. It is just a well-designed JavaScript virtual machine. It's performant because it compiles JavaScript to native code and uses generational garbase collection.

Re: Zed Shaw on C++

#72

I've seen this pattern a lot when it comes to the order of learning/mastering languages: C, then C++, then back to C

As the ancient Zen proverb goes:

The novice programmer looks at the code and sees bit, bytes, pointers and functions. The advanced programmer looks at the code and sees class hierarchies, design patterns and frameworks. The master programmer looks at the code and sees bit, bytes, pointers and functions.

Re: Zed Shaw on C++

#73

Earlier quoted context omitted.

"const *const char &" is not valid C++ syntax, so I'm pretty sure you can't increment it. Therefore, anyone saying you can increment it doesn't understand it. QED.

There's this thing called a joke . . . I believe that's waht Zed is making here.

You Sir, win a dollar! I think to make the joke really clear I'd have to add a few more consts and some pointers in there.

Re: Zed Shaw on C++

#74
post #31

Earlier quoted context omitted.

It has grabbed and maintained complete domination of nearly all performance sensitive code in games and desktop software, for nearly a generation now which is an unprecedented reign in computing history. That's a pretty good start to me.

Are you saying that the complete domination claim is also true in comparison to C ?

Yes, I think this is the funniest thing about C++. Everyone who loves it thinks it's the most popular language...well except when compared to C.

Basically, until you can kill C your language really isn't that popular. It's a fad by comparison.

Re: Zed Shaw on C++

#75
post #35

"If I wanted to fry my brain trying to figure out how to add two numbers with templates I'd go use LISP." Probably just a tongue in cheek comment, but I wonder what he meant.

Probably another run-of-the-mill confusion of macros for templates. "LISP" is a convenient red-herring to throw into PL diatribes; it shows the speaker has some authority since he is "aware" of Lisp, and the glowing and mystical connotations that this, vague, awareness carries.

No, more a nod to Lisp getting "metaprogramming" right when C++ screwed them up. If I've gotta do it, I'd rather do it in a language where the turing completeness wasn't designed to be a tarpit.

Re: Zed Shaw on C++

#76

I love C++, but I upvoted this because most C vs. C++ rants focus on things that are not actually C++'s biggest problems. This is one of the few C++ rants that actually brings up of legitimate points. They are not reasons that would stop me personally from preferring C++ over C, but they are valid criticisms. P.S. On the subject of format strings vs. cout and the "<<" madness, C++0x's variadic templates will allow a…

Actually, this is what I loved about Grace. It was like all the crap that pissed me off about C++'s design decisions just went away. It made C++ so nice to work with.

Re: Zed Shaw on C++

#77

Call me unlucky, but I've never worked at a company that had a high percentage of programmers (myself probably included) that could write solid C++ using anything more than the absolute basics, i.e. basically a C subset. I'd pretty much agree with Zed's rant, that C++ often isn't worth the bother, unless you have a project that specifically requires C++ features, and you have a development team that can actually writ…

I think this is a key point, the language doesn't matter as much as the capability and training the people using it have. This is why all these language arguments are rather irritating, because I'll typically use what works best. On some projects, C++ is great. On other projects C is best. Python is great for some things too.

Re: Zed Shaw on C++

#78
post #11

Earlier quoted context omitted.

The best pro C++ argument is that for all its flaws there's nothing out there that completely replaces it and it's still widely used. My own view: I'm not in love with C++, but it's not nearly as bad as everyone makes it out to be. Most of the arguments I hear against C++ are the same tired things I've heard hundreds of times. They all have a grain of truth, but nothing so bad as to condemn the language.

My short rant: C++ is as bad as they say it is. It is horrible, it is the worst language in the world ... except for all the other (a la Winston Churchill and democracy). The horrifical complexifications of C++ are just terrible, yet every one of them has a reason behind it. And also, the horrifical complexities are a bit more optional than the horrifical complexities of, say, Java. There isn't another language that…

Well, we can agree to disagree here, but my belief is that OO is a impedence mismatch for writing "low-level efficiency of direct pointer manipulation and other C features". It's kind of like saying, "There is no 16 wheel semi truck that can win the Tour De France." Maybe you shouldn't be using a 16 wheel truck.

Re: Zed Shaw on C++

#79
post #16

Exceptionally good critique. But there are exceptions: programming for Google's V8 in C++ is a pleasure. I've never seen any interpreter code so clean and easy to extend. Like a breath of fresh air.

Embed V8 into Python, then tell me how great C++ is.

In other words, C++ is great until something else has to call it. Then you're hosed and end up wrapping everything in C anyway.

Re: Zed Shaw on C++

#80
post #15

Earlier quoted context omitted.

"There appear to be a lot of good rants against C++....Are there any good passionate pro C++ versus C arguments?" By definition, the people who write the "entertaining" rants against C++ have an axe to grind. The people who like C++ just silently use it , and feel no need to write advocacy blog posts for the language. Even if they were to blog about it, it would be about as compelling as someone advocating for their…

Good advice generally, but what axes do Zed and Linus have to grind? Sounds like both just think C++ enables too much complexity to be worth the benefits.

It's actually possible to make C++ nice, the Grace library is wonderful. If I ever have to C++ again I'm totally grabbing it and using it. The Grace value types and type safe format operations are just the best thing ever.

My problem though is it's not the right tool for the job. Simply having access to C level APIs doesn't instantly mean your language is awesome at making servers and operating systems. Especially if that same language can't quite figure out what the hell really happens on a copy, or during an exception, or can't make decent strings and data buffers.

Post reply on HN