Conversation

Replying to
I find it to be the opposite. A lot of modern styles also encourage trying to be more efficient than the idiomatic C code with lots of dynamic allocations / copies. Most of the memory corruption bugs that I run into are in C++ despite there being about an equal amount of C code.
3
3
I think it bites off more than it can chew. It's great to do things like zero copy parsing with string views when you actually have memory safe, but it's horrifying in C++. It would be horrifying in C too but I don't see people doing this kind of stuff pervasively.
1
1
C++ lets people use super dangerous abstractions in a way that looks very clean and safe. A lot of modern C++ is extremely dangerous despite seeming very high level and concise. It just isn't suited for the code styles that people are using (lots of closures, iterators, etc.).
1
3
It's a lot different in Rust where the language enforces memory safety and prevents dangling references (including iterators, string views, etc. and anything else made out of lightweight references), use-after-free, data races and so on. Fancy C++ encourages having these issues.
1
Show replies