Weasel
So you think Rust's syntax is dumb because you don't like "let", but think "int derp(int arr[static const restrict volatile 5]);" is perfectly fine? Via. Anyway, others already tried to explain that "let" introduces patterns, not necessarily variables, and why immutable bindings are recommended (included in C++).
You asked a couple of pages ago what I didn't like about "const". I think it's mostly useless in C and C++ because it doesn't apply transitively through pointers and references. If you get a pointer to a const struct it means that you can't change it, without saying anything else about what happens:
Of course, if you're in the "good C and C++ programmers don't need that immutability crap" camp, there's not much more to argue about.
So you think Rust's syntax is dumb because you don't like "let", but think "int derp(int arr[static const restrict volatile 5]);" is perfectly fine? Via. Anyway, others already tried to explain that "let" introduces patterns, not necessarily variables, and why immutable bindings are recommended (included in C++).
You asked a couple of pages ago what I didn't like about "const". I think it's mostly useless in C and C++ because it doesn't apply transitively through pointers and references. If you get a pointer to a const struct it means that you can't change it, without saying anything else about what happens:
- other code, on the same thread or others can change your struct
- the compiler has to reload the const data from memory if you've called other functions in the meanwhile
- you can unintentionally change data through your pointer because const is not transitive
- you don't know if the data you're accessing transitively is being modified by other code at the same time
Of course, if you're in the "good C and C++ programmers don't need that immutability crap" camp, there's not much more to argue about.
Comment