3 ms·
As somebody who writes both JS and Rust: yes, Rust does prevent most runtime errors. But this isn't without a cost; it's much more expensive to build abstracti
by joepie91_ 8y ago
As somebody who writes both JS and Rust: yes, Rust does prevent most runtime errors.
But this isn't without a cost; it's much more expensive to build abstractions in Rust than in JS (although still cheaper than in most languages), for example, and the strictness does create problems with interoperability ergonomics in some places, especially when working with multiple third-party dependencies.
This goes back to my earlier remark about tradeoffs; strictness is not without its costs. The tradeoffs may be worth it to you, or not, or only for some projects - but it means that it makes no sense to paint things like dynamic typing as inherently bad; it just makes different tradeoffs.
I do share your sentiment of missing such 'upfront error-reporting'; that's precisely why I'm working on better tooling for this, of which the variable-renaming is just one aspect :)
- linkmotif 8y agoI’m not the best programmer but personally I avoid building abstractions as long as possible, deferring until the abstraction is as obvious as possible. The cost then becomes basically irrelevant because the value is so great. Writing JS even with ES6+ is really unpleasant for me. Abstractions or no asbractions, my mental capacity is quite limited compared to a compiler with 2 cores and 8GB of memory.