3 ms·
I think you missed the point I was trying to make. C/C++ currently: 1.) "variable" -> something that is subject to change 2.) "const variable" -> an unchanging
by tyfighter 4y ago
I think you missed the point I was trying to make.
C/C++ currently:
1.) "variable" -> something that is subject to change
2.) "const variable" -> an unchanging thing that is subject to change (I guess you could say it only changes once).
This thing and Rust:
"constant" -> something unable to change
"mutable constant" -> a changeable constant...what?
Even "mutable variable" -> a changeable thing that is a thing that is subject change doesn't make much more sense.
It is fine for "things" to be immutable by default, and in fact I think they should be. I just think "mutable" is keyword smell similar to "decltype" because type wasn't keyworded from the start.
- tialaramex 4y ago> This thing and Rust: "constant" -> something unable to change "mutable constant" -> a changeable constant...what? "What?" indeed. Rust doesn't have "mutable constant". Rust's "const" is actually a constant, unlike in C where "const" means "Sort of immutable, although maybe not". I guess maybe you've been told something about Rust like "let is kinda like C++ const" and so you've come to the erroneous conclusion that somehow "let mut" means "mutable constant" but that's just because you didn't really understand, blame either your attention or the poor explanation, it's surely nothing to do with Rust which has never said this is "mutable constant" since that's nonsense.
- deleted 4y ago[deleted]