Live data from Hacker News

C++: Is It Really a Cruel Joke? (2003)

webhome.phy.duke.edu

21–30 of 155 posts

Re: C++: Is It Really a Cruel Joke? (2003)

#21
From the "interview" of "Stroustrup":

> ... You know, when we had our first C++ compiler, at AT&T, I compiled 'Hello World', and couldn't believe the size of the executable. 2.1MB

> Interviewer: What? Well, compilers have come a long way, since then.

> Stroustrup: They have? Try it on the latest version of g++ - you won't get much change out of half a megabyte.

So, for grins, I did, with the gcc7 port from macports, which is GCC 7.3.0.

-rwxr-xr-x 1 ssta staff 8968 Jul 5 10:40 hello

The C version, using printf instead of (gasp) std::cout, clocked in at 8432.

Re: C++: Is It Really a Cruel Joke? (2003)

#22
post #2

I feel compelled to note that this page is from 2003-05-13, so I have no clue how much of its gripes are still valid in 'modern' C++ :)

I wonder how things have progressed from a security/stability standpoint - my OS definitely crashes a lot less, I'm guessing because there is less C in it now...

Re: C++: Is It Really a Cruel Joke? (2003)

#23

> There was this Oregon company - Mentor Graphics, I think they were called - really caught a cold trying to rewrite everything in C++ in about '90 or '91. I felt sorry for them really, but I thought people would learn from their mistakes. I've talked to some of the people at Mentor Graphics who were there during that period. The company basically went from #1 in the industry to #3 or so during the course of the C++…

> Inheritance chains were 5 or 10 classes deep.

30 years later, I still run into the same problem regularly. I'm not sure why, but this seems to be an anti-pattern that everyone needs to learn about the hard way.

Re: C++: Is It Really a Cruel Joke? (2003)

#24

Dr. Stroustrup took a lot of pain to ensure the language was useful and did not break backward compatibility. He also always maintained that if you don't use a feature you shouldn't pay for it (in terms of performance). Eventually, it became even more popular and there is now a whole organisation behind the international standards for the language. The book "The Design and Evolution of C++" helps one understand why s…

I always felt that if you wanted the same functionality as c++ in terms of performance, flexibility and power of abstraction, you'd end up with something as complex as c++.

Modern c++ shows there was/is room for improvement, but it does not fundamentally simplify the language imo.

Re: C++: Is It Really a Cruel Joke? (2003)

#25
Having spent the past decade working with python, I've always considered C to be a mystical black box for hardcore systems guys. I recently needed to write some high performance networking code so I decided to give it a shot. At first I found it painfully verbose and confusing, with the simplest operations requiring lines of code. After a couple days I found it to be rather refreshing, it encourages you to look at memory from a more basic perspective and efficiency just falls in place. Pointers are confusing and strict typing takes some getting used to, but they are awesome. It's great to be able to use the same memory with different types and structures, so better than copying things around. I still love Python, but I will be using C again when performance matters.

Re: C++: Is It Really a Cruel Joke? (2003)

#27

> There was this Oregon company - Mentor Graphics, I think they were called - really caught a cold trying to rewrite everything in C++ in about '90 or '91. I felt sorry for them really, but I thought people would learn from their mistakes. I've talked to some of the people at Mentor Graphics who were there during that period. The company basically went from #1 in the industry to #3 or so during the course of the C++…

> the hours were normal.

What were 'normal' hours for a programmer in the 1990s? Did you guys work 9-5?

Re: C++: Is It Really a Cruel Joke? (2003)

#29
post #2

I feel compelled to note that this page is from 2003-05-13, so I have no clue how much of its gripes are still valid in 'modern' C++ :)

The author didn't really complain about too much specifically, just generally complaining about the language. I guess it's hard to say whether or not the situation is better in the latest versions of C++ (though as someone who uses C++ an awful lot I would assert that it has gotten much much better).

That said, I think the complaint maybe comes down to coding style and architecture of the thing they're coding. They seem to make a joke we'd maybe more closely associate with Java than C++ these days. Also Microsoft's C++ style is awful. So if that's the only experience you have with C++ I would be hard-pressed to blame you for hating it.

Re: C++: Is It Really a Cruel Joke? (2003)

#30

Dr. Stroustrup took a lot of pain to ensure the language was useful and did not break backward compatibility. He also always maintained that if you don't use a feature you shouldn't pay for it (in terms of performance). Eventually, it became even more popular and there is now a whole organisation behind the international standards for the language. The book "The Design and Evolution of C++" helps one understand why s…

I read that book around 1998 and was an instant convert. C++ has a steep learning curve, and does not stop you from getting yourself into a lot of trouble, but it does stand up to Bjarne’s original promise about performance.

IMHO the STL is one of mankind’s greatest accomplishments.

Post reply on HN