Originally posted by mdedetrich
View Post
I'm not asking for an actual example of actual production code, just something to illustrate an example of such problem that can appear in production code. It can be short and that's actually preferable, I just want to know WHAT exactly.
Also, Mozilla's C++ code is horrible and full of hacks and stupid stuff. Comparing it to Rust is pointless since it's a lot worse than most C++ code I read. It's also full of macros, so you can imagine how horrible that is.
Again, I'm not bashing the "return address of stack variable" because of the simple examples. Simple examples are perfectly fine. I'm bashing what they represent, which is, returning address of stack variable. That's what's beyond dumb. A mistake that you can only make while drunk. And anyway it's so trivial because any compiler will warn about it. Not sure why Rust proponents keep bringing it up.
How does Rust handle concurrency better than C++ with RAII/smart pointers/etc? Simple example please. And I hope it's not about its standard library, because I want core language examples. Standard library can be replaced with better APIs or libraries, so that's not a good point to make. You don't need an entirely new language for that.
Comment