3 ms·
My experience would disagree with this. Features like enums, traits and newtypes make it easy to encode a lot more of your programs invariants statically, and i
by nicoburns 9y ago
My experience would disagree with this. Features like enums, traits and newtypes make it easy to encode a lot more of your programs invariants statically, and in ways which naturally fit the problem domain (as opposed to Java where I often feel like I'm trying to squash my structure into a class hierachy which it doesn't really fit).
In addition the explicit error handling (together with enum error types) allow the compiler to check that you have handled every error case.
Rust has enabled me to write programs that just don't contain bugs (after an initial testing period). This is certainly acheivable with other languages, but it involves a lot of discipline, writing tests, etc. Rust makes it easy.
- guelo 9y agoMaybe Java is a bad example. But there are plenty of languages that have similar features to what you mention that are a lot easier to learn.