Live data from Hacker News

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

webhome.phy.duke.edu

81–90 of 155 posts

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

#81

Earlier quoted context omitted.

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.

I love Rust. Especially for emudev and embedded development (fields I would traditionally use C or C++). However, it still performs worse than C++ in most cases [1].

[1] https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

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

#82
post #51
post #30

Earlier quoted context omitted.

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.

C++ the language, maybe. STL really is a cruel joke. is it ok to mutate a data structure while an iterator to it is live? It depends, which makes it much less abstract and generic than it could be (and that people believe it is) Error messages are useless. Compilers can and do (recently) help with that, but the main issue is the convoluted STL design in which every instantiation’s type name actually takes a full 80x2…

Could be true, but a modern language such as Rust has its own problems:

https://news.ycombinator.com/item?id=16442743

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

#83
post #50

Earlier quoted context omitted.

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/

I would encourage you to use Cython instead of Nim if you're looking for Python-like syntax combined with C performance.

Why is that?

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

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

You didn't exclude C++, so I'll vote for that. Like you said - it isn't dying off and there are lots of C++ programmers out there so hiring is easier than with less popular languages.

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

#85

Earlier quoted context omitted.

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

I blame java

Don't blame Java. Blame programming instruction.

If it's anything like when I was in school, as soon as the curriculum trots out its first object oriented language, you get a lecture about how is-a relationships are the greatest invention since the compiler, and deep inheritance hierarchies are both the most practical and the most morally righteous way to organize your abstractions.

(Meanwhile, ironically enough, I'm not sure I've ever heard a CS instructor even mention the Liskov Substitution Principle.)

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

#86
post #57

It is a shame that HN now is totally the mic-phone of Mozillia. All is task is to help Mozilla to slander their competitors, for example, Chrome vs firefox, c++ vs rust,...

Since it seems you won't post anything else, we've banned the account. We're happy to unban accounts if you email hn@ycombinator.com and we believe you'll start commenting substantively.

https://news.ycombinator.com/newsguidelines.html

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

#87
post #60
post #49

Earlier quoted context omitted.

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.

> Not all languages that are used get complaints in equal proportion It's because they are not used in equal proportion.

Presumably "equal proportion to their use" is implied.

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

#88
post #82
post #51

Earlier quoted context omitted.

C++ the language, maybe. STL really is a cruel joke. is it ok to mutate a data structure while an iterator to it is live? It depends, which makes it much less abstract and generic than it could be (and that people believe it is) Error messages are useless. Compilers can and do (recently) help with that, but the main issue is the convoluted STL design in which every instantiation’s type name actually takes a full 80x2…

Could be true, but a modern language such as Rust has its own problems: https://news.ycombinator.com/item?id=16442743

What you’ve just linked to is a solution to the issue mentioned above. Rust makes a lot of guarantees, but sometimes those guarantees run afoul of certain required operations in different contexts. For this reason the language has an escape valve, unsafe, and the unsafe blocks are blindingly obvious in the code.

To say it’s a problem is misleading at best.

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

#89
post #63

Earlier quoted context omitted.

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

Which OS? Linux and Darwin are still entirely C in the kernel, I believe. Windows is C++.

I use windows 10. Kernel is still Win32 C calls but I bet a lot of the services on top aren't.

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

#90

Earlier quoted context omitted.

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

I blame java

I blame inheritance.
Post reply on HN