Hacker News new | past | comments | ask | show | jobs | submit login

One habit worth trying to adopt early in this mode is running clippy, Rust's linter. Typically invoked as `cargo clippy`

Clippy likes idiomatic Rust and will suggest you change code that's not idiomatic into code which is, even when the machine code would be completely identical - the rationale being that the maintainer (later you with more Rust knowledge, a colleague, or even some stranger) is more likely to follow the idiomatic Rust and the whole point of source code is that it's for humans not machines.

Clippy is no substitute for a capable human reviewer, it has no sense of taste or style, no higher level understanding of the problem, but it's free and it's right there and unlike a human reviewer you won't feel judged which can be sensitive when you're learning a new language and are used to having mastery.






Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: