3 ms·
>Few languages have equivalents. (C++ and D are exceptions). I would say Rust is still better than C++ here, because in Rust const is default. In C++, people o
by Thorrez 2y ago
>Few languages have equivalents. (C++ and D are exceptions).
I would say Rust is still better than C++ here, because in Rust const is default. In C++, people often either forget to write const, or intentionally don't write const because writing it everywhere clutters up the code.
- berkut 2y ago> or intentionally don't write const because writing it everywhere clutters up the code I don't often like being judgemental (at least publicly!), but I'd argue that's just people being very bad developers... You could argue having to add '&mut' at call sites everywhere (i.e. opposite to the way C++ does const in terms of call site vs target site) also clutters up the code in terms of how verbose it is, but it's still largely a good thing.