|
|
|
|
|
by kaba0
1468 days ago
|
|
Rust has a cool type system, but I think you give it much more credit, like it doesn’t have dependent types where the implementation can often be filled in literally. Other than checking mutability and nullness, I really don’t think that Rust would be that much ahead compared to even an “older” language like Java. Also, java now has ADTs so “exhaustive checks” are available there as well. |
|
In C#, I can't tell at the call site whether a function could mutate what I pass in; not without looking at the implementation of the function and anything it passes that object to. With Rust, how it's passed in completely informs me about this. If it's passed by shared reference, it can't mutate. If it's passed by unique reference, it might mutate. If it's passed by ownership, then I can't access the instance any more anyway, so it's not my problem.