3 ms·
Rust makes tradeoffs explicit, which means you often have to make decisions you don’t have to worry about in other languages. I suspect this is where your perce
by mplanchard 3y ago
Rust makes tradeoffs explicit, which means you often have to make decisions you don’t have to worry about in other languages. I suspect this is where your perception of its being over-engineered may be coming from.
Traits are mostly well-trodden ground, being rather like typeclasses in Haskell. The ability to use them for both generic bounds and dynamic dispatch is lovely, but a source of confusion if you’re new to the language.
In my experience lifetime management is the biggest hurdle when you’re getting started. I’ll admit that five years into learning rust, with half of that working with it professionally, I still sometimes get lifetime errors that I don’t understand. However, I have gotten much better at them over time (name your lifetimes well! it’s a lot more helpful for understanding for a lifetime to be named ‘frobnicator than ‘a, IMO).
Anyway, only thing for it is to give it a shot! The feeling of easy performance wins and strong type safety is hard to give up once you’re used to it.
- estebank 3y ago> I still sometimes get lifetime errors that I don’t understand. I'd like to remind people that errors you don't understand are bugs and I'd encourage you all to file a ticket when encountering any: https://github.com/rust-lang/rust/issues/new?assignees=&labels=A-diagnostics%2CT-compiler&projects=&template=diagnostics.yaml https://github.com/rust-lang/rust/issues/new?assignees=&labe...
- mplanchard 3y agoThanks, esteban! I’ll try to keep this in mind. It happens much less often these days, and it’s always hard to disambiguate my own ignorance from the quality of the error message :)