|
|
|
|
|
by unsafecast
1422 days ago
|
|
> If it is so bad, it should (in the sense of how things would be in an ideal world) not compile. Yes, C++ can be a bad solution to a lot of problems, and that's okay. Use rust if you need a machine guarantee for memory safety (or you just like the language), you can use Go if you just don't care about that at all and want the language to take care of it. But you can use C++ for non-critical software that needs to be fast (games come to mind). Rust can be too much of a mental overhead than it's worth for some. That closure is just not a good example. Nobody would write this, because when writing C++ code you _do_ think about whether you want a reference or not. Sure, a lot of bugs can happen but this is not, in my opinion, one of them. If you want to prove a point, prove it fairly. Note: I don't use C++ anymore, and I don't like it very much for other reasons. |
|
Rust has the least mental overhead of any language I've ever used. The compiler literally takes all the mental overhead away.