Live data from Hacker News

Zed Shaw on C++

librelist.com

131–140 of 210 posts

Re: Zed Shaw on C++

#131
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?

I've experienced problems with java's concurrent mark and sweep collector. It will stop the world, two times, but two much shorter times than a non-concurrent mark and sweep. So it is definitely an improvement in the duration of the stop-the-world.

The problem tends to be that you need to tune it, and even as you have tuned it, you can not promise that under special condition it will fall back to a more primitive collector since the optimality it was tuned for doesn't hold anymore.

I would never argue giving up garbage collection entirely because of these failure scenarios. I would much rather look at moving some critical part of the code out to a language with manual allocation, and let it perform the latency-sensitive bits.

Another mid-ground is to have separate isolate processes (heaps really) that can be stop-the-world collected without blocking each other. Erlang makes great use of this to accomplish "soft realtime", among other things.

Re: Zed Shaw on C++

#132
post #67

Earlier quoted context omitted.

The people who like C++ just silently use it Indeed. At my last job, working on trading software, we had around 35 maths or physics PhDs working on a C++ application. A few had personal blogs (cats, children, steam engines, etc) but as far as I am aware no-one there argued on the Internet about which language was best. C++ just doesn't attract self-publicists the way Ruby seems to.

> C++ just doesn't attract self-publicists the way Ruby seems to. That's a cheap shot ... Linus Tolvards is definitely not the Ruby-type. And his arguments are sound ... for system programming, C is a much better language because it's simpler, lacks magic, making the pieces of code easier to understand without the bigger context, and it's more portable. And for application-level programming, why would you chose a lan…

Try allocating a very large chunk of memory using a high-level language with garbage collector. It's not always about collection.

Re: Zed Shaw on C++

#133

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…

What do you think about D?

Until there's a single, stable, not-on-the-way-to-be-obsoleted version of D, with standard standard library, I'm not inclined to invest too much time in it.

I wish that D1 was oficially killed, and a stable strict subset of D2 ("D1.5") was chosen as a recommended future-proof version.

Re: Zed Shaw on C++

#134
post #67

Earlier quoted context omitted.

The people who like C++ just silently use it Indeed. At my last job, working on trading software, we had around 35 maths or physics PhDs working on a C++ application. A few had personal blogs (cats, children, steam engines, etc) but as far as I am aware no-one there argued on the Internet about which language was best. C++ just doesn't attract self-publicists the way Ruby seems to.

> C++ just doesn't attract self-publicists the way Ruby seems to. That's a cheap shot ... Linus Tolvards is definitely not the Ruby-type. And his arguments are sound ... for system programming, C is a much better language because it's simpler, lacks magic, making the pieces of code easier to understand without the bigger context, and it's more portable. And for application-level programming, why would you chose a lan…

> And for application-level programming, why would you chose a language without a garbage-collector?

Because your code uses some finite resources other than memory, and you don't want the ability to forget to release said resources when you're done with them and they go out of scope.

Re: Zed Shaw on C++

#135
post #118
post #65

The real problem with C++ is that there isn't a fucking split function in the standard library.

I donate you one: #include #include #include typedef std::vector Strings_t; Strings_t split(const std::string& string, char onChar) { Strings_t splitted; size_t lastSplit = 0; for (size_t i = 0; i

I never said I didn't know where to get one, or to actually write it. In fact, you can do it way simply with getline(). It just always pissed me off when I hack a little something and there is no split.. I then need to either include boost which is huuuuge compared to my 200 lines file.. code it myself, get a snippet from internet.

The point is: in C++, there are so much things.. It's like a fuckload of thousand of features to satisfy everyone. How the fuck can there be no split? Ruby, split, python, split, java, split, php, split, C# split, C++ -your-20-lines-function-which-only-support-splitting-on-a-char-but-not-on-a-string.

Re: Zed Shaw on C++

#136
post #96

There are great C++ projects, but the big compile/link times they have are not a small deal. Also the compiled libraries take a lot of space. Examples: Qt, wxWidgets, LLVM, boost Hopefully we have IncrediBuild at work, and we don't have to deal all the time with such huge frameworks.

You don't have to build these libraries from scratch every time. You could store pre-compiled binaries in a shared drive for every possible configuration, and developers can simply copy them to their machine. Not that big a deal.

Re: Zed Shaw on C++

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

I figure they have the axe of "I used this for a while, and really grew to hate it when I compared it to these other things I used" to grind. Sometimes the technologies you use just make you want to get something off your chest, you know?

Re: Zed Shaw on C++

#138
post #3

I really do love a good C++ rant.

Thank you for this post. For the life of me I cannot explain why, but it delighted me immensely, and I am inexplicably incapable of reading it in my head without an exaggerated British accent.

Re: Zed Shaw on C++

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

Perhaps this one fits as well:

Before mastering C, bits are bits, bytes are bytes and pointers are pointers. While learning C, bits are no longer bits, bytes are no longer bytes, and pointers are no longer pointers. After mastering C, bits are once again bits, bytes are once again bytes, and pointers are once again pointers.

Re: Zed Shaw on C++

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

I wasn't talking about web applications, and modern garbage collectors are not stop-the-world. Not to mention ... stop-the-world garbage collectors have a good reason for doing what they do. They are defragmenting the memory. You get that for free, when in C++ you would have to deal with hell if your app is doing lots of allocations ... see the shit the Firefox devs had to go through to alleviate the problems of heap…

Unfortunately we don't all have the luxury of rewriting all our code in the trendy language du jour.
Post reply on HN