3 ms·
It depends. - Rust is a complicated language, so novice developers probably use something else. - Its ownership/borrowing system makes sure that architecture
by davidkunz 4y ago
It depends.
- Rust is a complicated language, so novice developers probably use something else.
- Its ownership/borrowing system makes sure that architecture is not an afterthought (unless you pollute your code with countless smart pointers).
- You get memory safety in safe Rust code and don't need a garbage collector.
- Non-optimal solutions usually are visible/more cumbersome to write.
In the end it's up to the individual developer, but Rust really helps to produce high-quality code.
- BiteCode_dev 4y agoAnd the community and philosophy/culture the languages come with seems to promote that as well.
- moffkalast 4y ago> Non-optimal solutions usually are visible/more cumbersome to write How's that? The difference between a suboptimal and an optimal solution can be perfectly valid normal code for lots of procedures. It's not something that's knowable without semantic meaning of what the code's trying to do.
- davidkunz 4y agoA few examples: - Rust forces you to deal with errors and "null" values (Option). If you just unwrap them, it's visible. - Rust requires systems with clear ownership. You can opt out with various smart pointers, it's visible. - Rust requires you to use Box for heap allocations, it's visible. Note: I'm not talking about optimal solutions in the sense of "best algorithm", more in the sense of "well thought out and without lazy shortcuts".
- moffkalast 4y agoYeah I think that's just called enforcing best practices, not optimal solutions.
- davidkunz 4y agoOne cannot enforce optimal solutions but one can prevent sub-optimal ones through proper checks.
- moffkalast 4y agoYou keep using that word, I don't think it means what you think it means.