- cross-posted to:
- programming@programming.dev
- cross-posted to:
- programming@programming.dev
Turn on all clippy lints on day one – even the pedantic ones. Run the linter and follow the suggestions religiously. Don’t skip that step once your program compiles.
There’s a bunch of clippy groups to enable, but IME the pedantic ones can be kinda … not what you want. Especially the one about unnecessary moves annoy me, as it suggests what I consider an unnecessary long lifetime for a value instead.
TIL about
clippy::cargo
. Thanks!
Some people might dismiss Rust as being “unelegant” or “ugly”, but the verbosity actually serves a good purpose and is immensely helpful for building large-scale applications:
Here rust is trying to be unambiguous by forcing you to write just enough context when needed. It is not unnecessarily verbose at all and is not trying to be absolutely explicit about everything. When there could be more ambiguity, rust errs on the side of being more explicit which increases the verbosity. But when it is less ambiguous then it favors being less explicit. Hence why you can omit types and lifetimes in most situations but require them when it is not obvious what they should be.
I’m not new to Rust, but still a novice. And already loving the first point you make. This article is great (so far).
Pretty good read. Nothing very surprising and I might make the same kind of recommendations. I would have tried to phrase several things with less prejudice, though.