5 ms·
Am I crazy to say I prefer the ownership and copy/move system of C++11? It feels much easier to reason about but then again maybe that's just because I'm more f
by simfoo 12y ago
Am I crazy to say I prefer the ownership and copy/move system of C++11? It feels much easier to reason about but then again maybe that's just because I'm more familiar to it.
- sanxiyn 12y agoIt's easier (well, certainly simpler) and less powerful. The system certainly can be simplified a lot if you don't need memory safety.
- dan00 12y ago> It feels much easier to reason about but then again maybe that's just because I'm more familiar to it. I'm a professional C++ programmer for a decade and have started to look into Rust, and there's no way that C++ is easier to reason about. There's no automatic copying of complex data in Rust, you can't move something away and later use it again, you can't invalidate interators and this list goes on and on. At the beginning you have to get used to the borrow system of Rust, learn the idioms, but after that, it really seems to be in a lot of parts a better C++.
- exDM69 12y ago> Am I crazy to say I prefer the ownership and copy/move system of C++11? Yes you are, and the only reason for that is that Rust's system is checked by the compiler, C++ is not. It's really easy to screw up with C++, forgetting to make something noncopyable and then causing double free or use after free issues.
- twic 12y agoPerhaps it's easier in the sense of "less arduous", but ultimately not easier in the sense of "more productive". The C++ model is less spiky and painful, but just doesn't let you be as confident about your program as the Rust model.