3 ms·
But Rust puts a unique amount of information into the types. This can get annoying sometimes, but it means typechecking better predicts correctness. For exampl
by iudqnolq 4y ago
But Rust puts a unique amount of information into the types. This can get annoying sometimes, but it means typechecking better predicts correctness.
For example, a c header type might have an out parameter and an error code returned. The interaction between those two isn't specified in the type system.
I personally require discriminated unions (i.e. enums where each variant can hold its own type of data) before I consider a type system adequate.
- kazinator 4y agoBut that's way beyond someone coming from JS or Python, just being excited that there are types on the parameters and the compiler tells you when basic things are wrong.
- iudqnolq 4y agoI personally came from JS to Java and got annoyed I had to do all this work specifying types but they gave me essentially no benefit. Then I tried Rust and realized why types were good. (and then Kotlin)