|
|
|
|
|
by neilv
2544 days ago
|
|
I appreciate what you're saying, and that there's some truth to that, but I think there's at least two components to good allocation management in C++ (or C, or other memory-unsafe language)... The first component is conventions and idioms for managing allocations, and Rust will force you into (and support) some good (but nontrivial) ones. The second component is self-discipline. Look at the long history of vulnerabilities in C and C++ code that are due to carelessness -- of an oops that a programmer made when they knew better. If what's being considered is Rust as a stepping stone to C++, how much does Rust help with the first component, and is Rust even counterproductive for the second component? Regarding counterproductive for the second component, you might've seen a conventional practice of grinding the Rust Clippy until the code compiles. I don't know how that affects the development of self-discipline (e.g., maybe some people try to make a practice of being Clippy-free on every compile attempt?), but it seems a reasonable and interesting question to ask. (I'm not dissing Rust for this. I mostly like Rust, and would be happy to be working in/on it.) |
|