Live data from Hacker News

Zed Shaw on C++

librelist.com

181–190 of 210 posts

Re: Zed Shaw on C++

#181
post #63

Earlier quoted context omitted.

gcc compiles Obj-C, but without some of the improvements apple has made. I personally wish Obj-C were more common because mindshare is a real issue.

Ironically, the whole iphone apps goldrush seems to have contributed in a big way to increase its mindshare. Obj-C is very beautifully designed, I especially like how it adds message passing OOP to C with very minimal syntax additions. But then calling objc_msgSend for every message send, does have a small performance penalty attached, which mostly static languages like C++ don't have to pay.

> a small performance penalty attached, which mostly static languages like C++ don't have to pay.

Then code the performance sensitive parts in C and link it from the language that is best suited to express the solution.

Re: Zed Shaw on C++

#182
post #56

Earlier quoted context omitted.

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

Somebody below said just the opposite. Personally, I find V8 really nice to read and work with. Which part of it do you not like?

Just so we are on the same page. I am refering to the V8 codec not the Javascript engine.

Re: Zed Shaw on C++

#183

Earlier quoted context omitted.

> const-correctness may be another misfeature (I know I make fun of it), but the point isn't hard to see: if you take the time to const-correct your code, the compiler will spit out errors that would have otherwise been runtime faults. I think it is so interesting the mentality of static typing people. I would much prefer handling the few resulting run time faults than having to stuff with my code with const. Anyway,…

No compiler error ever ruined a NASA mission.

Funny, but imo misses the point.

The beauty of dynamic typing is that it makes the writing of the code easier, which makes development shorter, which gives you more time to thoroughly test your code. After years leading a QA team, I'm convinced that more time testing is always superior to more time writing code, even if the code you're writing is there to stop bugs!

Re: Zed Shaw on C++

#184

I'm going to keep saying this until I turn blue in the face. Perhaps if I stamp my feet it might get more attention (wink) Please stop confusing the language with the APIs or the available libraries and features of the language. This sounds simple, but it's profound: simply because you can do something, that doesn't mean that you have to do it that way. To use Zed's example, let's say I'm hacking around a lot of stri…

"What's wrong with rolling a string class, adding a member or two?" The fact that it's 2010? A language and its standard library are theoretically different things, but in any practical sense, the choice to use a language carries with it the choice to use its standard library. Additionally, the way the standard library is usually reflects constraints placed on it by its language. Java, for example, has a verbose and…

"A language and its standard library are theoretically different things, but in any practical sense, the choice to use a language carries with it the choice to use its standard library."

That's less true when talking about C/C++ than other languages. C/C++ are quite often used in embedded systems, which often have problems with dynamic memory allocation, code size, etc. This means that many embedded systems don't use the standard library, or only use portions of it.

Re: Zed Shaw on C++

#185
post #122
post #113

Earlier quoted context omitted.

Perhaps you need to run deterministically without a stop-the-world garbage collector? A) the world is bigger than simple web applications and B) some of us have been doing this for a long time.

Can you give an example of stop-the-world garbage collection?

If you meant actually existing stop the world GC, the server GC in Microsoft's CLR stops all threads on a processor to do GC.

Re: Zed Shaw on C++

#186
post #125

Earlier quoted context omitted.

Ironically, the whole iphone apps goldrush seems to have contributed in a big way to increase its mindshare. Obj-C is very beautifully designed, I especially like how it adds message passing OOP to C with very minimal syntax additions. But then calling objc_msgSend for every message send, does have a small performance penalty attached, which mostly static languages like C++ don't have to pay.

So does C++ have any price to pay for say vtables?

Thats why I called C++ `mostly static`.

Re: Zed Shaw on C++

#187
post #182

Earlier quoted context omitted.

Somebody below said just the opposite. Personally, I find V8 really nice to read and work with. Which part of it do you not like?

Just so we are on the same page. I am refering to the V8 codec not the Javascript engine.

The WebM one? It is called VP8, not V8.

Re: Zed Shaw on C++

#188

Doesn't the D language fix a lot of the issues that Zed is complaining about? Constantly surprised that it's not more mainstream...

D could have saved us from the horrors of C++, but it dropped the ball.

http://www.jfbillingsley.com/blog/?p=53

http://news.ycombinator.com/item?id=911858

Re: Zed Shaw on C++

#189
post #78

Earlier quoted context omitted.

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.

If you cut a couple wheels off of an 18-wheeler, you could travel the 3642 km of the Tour de France in about 36 hours of driving, which would be about 3 days on a leisurely, safe schedule. The bicyclists take 22 days to do the same thing.

So, there are really only a couple of problems:

• if you're Zed Shaw, you apparently want to cut two wheels off an 18-wheeler, and if you're Zed Shaw, you're likely to screw up and choose the drive wheels for your demented sacrifice. You do that, the sucker won't even roll.

• the stupid hatas who judge the race won't acknowledge your achievement. Something about the allowed types of bicycle. Is that analogous to how you can't run Ruby on a microcontroller with 1024 bytes of RAM, maybe? Because you can sure as fuck run C++ on it.

Anyway, direct pointer manipulation has been part of OO environments since the beginning. The purest current incarnation might be SqueakNOS (ever seen an IDE driver written in Smalltalk?) or SBCL's alien, but the most practical one is probably C++. Rust, Golang, and ATS seem like up-and-coming contenders.

Edit: oh, I forgot D. D's been an up-and-coming contender for more than ten years now.

Re: Zed Shaw on C++

#190
post #150
post #124

Earlier quoted context omitted.

There is no other language for crafting large-scale, high performance tools is demonstrably false. There are high-volume low latency world-class financial systems written totally in Java. The seriously complex and high-performance ITA system is written in Lisp. And if you read Coders at Work, some of the criticisms of C++ suggest that the reason behind many of the C++ features is that Bjarne didn't want to say NO . A…

I guess, if you set your mind to it, you could probably make Forth do a nice mixture of low and high-level stuff, too. But why do people insist on being able to do low and high level stuff in the same language? What's wrong with, say, using Python for high level stuff, and calling into C for low level tasks? C+Python is probably more convenient than C++.

Actually Boost::Python makes python and c++ mix beautifully. I just started playing with it a few days ago and am seriously impressed. I'm planning on using it to write a WSGI gateway to put in front of my bottle.py apps.
Post reply on HN