Live data from Hacker News

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

webhome.phy.duke.edu

41–50 of 155 posts

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

#41

> It is sufficiently fascist that it more or less "forces" students to program with a certain discipline. Never mind that no real coder EVER writes programs with that particular discipline once they get out of diapers... I wonder what would be the author's opinion of Rust

>> Never mind that no real coder EVER writes programs with that particular discipline once they get out of diapers...

This line appears to be a snide remark at class-based OOP, for which a regular criticism is that real-world projects rarely slot neatly into the sort of "Cow is-a Mammal is-a Animal" taxonomical hierarchy that is used to teach class-based OOP in school. Rust doesn't have classes or taxonomical hierarchies, and encourages struct-first POD design (similar to C), augmented by traits which provide shallow has-a relationships (composition) rather than deep is-a relationships (inheritance).

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

#42

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.

Only if it need to have backward compatibility. Rust doesn’t so it can be vastly simpler.

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

#43
post #37

Why do we as developers feel a need to constantly trash the things we don't like? If you don't like something, don't use it. Talk about the things you do like instead.

Because talking trash is fun.

Maybe the discussion will identify some problems with a thing. There's an infamous piece "PHP is a fractal of bad design" that I found very insightful.

But, honestly, it's mostly because it's entertaining.

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

#44

"There are only two kinds of languages: the ones people complain about and the ones nobody uses." -- Bjarne Stroustrup [1] [1] http://www.stroustrup.com/bs_faq.html#really-say-that

This has got to be one of my favorite quotes about programming languages. ;-)

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

#45
I know C++ isn't really dying off, but what is the best platform-agnostic compiled object-orientated language these days?

I liked Borland Pascal, and I know Delphi is kind of ticking along, but I'd rather invest in a language that is growing.

Swift looks nice but still seems too Apple focused.

Don't want to start a war, just open to some tips on the ecosystem..

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

#46
post #45

I know C++ isn't really dying off, but what is the best platform-agnostic compiled object-orientated language these days? I liked Borland Pascal, and I know Delphi is kind of ticking along, but I'd rather invest in a language that is growing. Swift looks nice but still seems too Apple focused. Don't want to start a war, just open to some tips on the ecosystem..

D has potential

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

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

The STL doesn't always live up to the standard of "zero overhead abstractions." The list is not high performance, many implementations of hash tables never shrink (and used to have O(n) erase!), and deque is a bad joke (no chunk size control, plus laughable fixed chunk size on some common platforms).

Many high performance projects use vector but few other containers.

If the STL had a lesson to teach us it should have been "iterators everywhere, including for your own algorithms and container types." Instead most people learned "C++ has all the containers you need built in, throw away your performance tricks and let it call malloc a million times."

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

#48
post #45

I know C++ isn't really dying off, but what is the best platform-agnostic compiled object-orientated language these days? I liked Borland Pascal, and I know Delphi is kind of ticking along, but I'd rather invest in a language that is growing. Swift looks nice but still seems too Apple focused. Don't want to start a war, just open to some tips on the ecosystem..

Rust definitely is a good choice, if you can give up inheritance.

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

#49

"There are only two kinds of languages: the ones people complain about and the ones nobody uses." -- Bjarne Stroustrup [1] [1] http://www.stroustrup.com/bs_faq.html#really-say-that

While the OP article is indeed unhelpful and unconstructive, it's a pet peeve of mine to see people reference this quote (in the context of any language, not just C++) as a way of deflecting criticism. Not all languages that are used get complaints in equal proportion, and finding the constructive complaints is how we work towards making all languages gradually better.

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

#50

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 me…

I stumbled into Nim recently and this thing "just works". Python-like syntax, performance like C. This is what C should have been, I'd say.

https://nim-lang.org/

Post reply on HN