News for hackers. Stuff that matters.
Re:C/C++ vs. Rust Performance by dathinab on Sunday November 01, 2020 @01:00PM (#24961213)
Idk about "shitty C" but indeed C++ being a super set of C is a common misconception, followed by the misconception that it's nearly a superset of C. ;=)

Simplest example is that a `void func()` decl in C and C++ have different semantic meanings.

Re:C/C++ vs. Rust Performance by simias on Sunday November 01, 2020 @01:50PM (#24961532)
I think "nearly a superset" is correct, the empty argument list doesn't really make enough of a difference to really make it a completely different language. I also don't think I've ever seen this "feature" of C used productively in modern codebases, except maybe to declare generic function pointers in something like dlfunc. In general it's just that people are too lazy to type `void func(void)` (or don't know the difference).

You can also tell that the C++ standard committee agrees with this to some extent since they tend to add C novelties into the C++ standards whenever possible to make it easier to write compatible code, for instance: https://en.wikipedia.org/wiki/C%2B%2B11#Improved_C_compatibi...

Re:C/C++ vs. Rust Performance by loeg on Sunday November 01, 2020 @02:14PM (#24961724)
Standard C++ still lacks C99 compound literals, doesn't it? That's the biggest gap I've run into. It is a common and practical construct in C.
Re:C/C++ vs. Rust Performance by jstimpfle on Sunday November 01, 2020 @03:01PM (#24962042)
And designated initializers.
Re:C/C++ vs. Rust Performance by ncmncm on Sunday November 01, 2020 @11:09PM (#24964757)
Yet, C++ supports designated initializers.
Re:C/C++ vs. Rust Performance by Gibbon1 on Sunday November 01, 2020 @02:04PM (#24961644)
I feel like treating C as a subset of C++ has done real harm to the language.
Re:C/C++ vs. Rust Performance by simias on Sunday November 01, 2020 @03:01PM (#24962043)
I agree that teaching C++ as "C and then some stuff on top" is probably a bad idea. But I also think that it's not technically incorrect to say that "C is mostly a subset of C++", at least as far as most C constructs will work in C++ with only minor tweaks.

It's a bit like saying that operating the windscreen wipers is a subset of knowing how to drive a car. It's strictly correct, but it's probably not where you should start nor where you should put most of your attention if you're looking to get you license.

Re:C/C++ vs. Rust Performance by rrdharan on Sunday November 01, 2020 @02:21PM (#24961780)
Which one?
Re:C/C++ vs. Rust Performance by Gibbon1 on Sunday November 01, 2020 @04:32PM (#24962683)
No arrays, no real strings. Pushing UB issues on the programmer instead of forcing the compiler maintainers to deal. No closures. Threading as a first class construct. No modules. Standard Library is increasingly a bad joke.

What's happened is the direct opposite of C++ where every fad gets added to the language. With C lots of standard proven features don't make it into the language.

Re:C/C++ vs. Rust Performance by rrdharan on Sunday November 01, 2020 @07:33PM (#24963856)
Heh, yeah my point was you could plausibly apply your statement to both languages, i.e. their confusing coupling impedes both in different ways.