-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce fmt and clippy early on as "recommended practices" #1725
Comments
This is a good idea! We work hard to resist the urge to introduce something "early" because it's "important" -- otherwise we'd have all four days' content covered before lunch on day 1! We try to adopt a "circular" approach where things are mentioned lightly at first, and then revisited in more detail. Note that we do mention We had a few other "one-off" topics that didn't warrant their own 30-minute segment. For a while those were in a sort of "miscellaneous" segment, but that was not great for students. Most of that content has now been mixed into other segments as a light-weight aside. For example, Documentation is covered in the standard-library-types segment. Maybe all of the points above could be covered in a slide in the "Testing" segment? |
Heh, agree, prioritization is hard. I guess my concern is that most students have to be re-molded from other languages - they try to keep old habits that worked well before, but might not apply to Rust... Like using Recently I had a long training session with a novice Rust dev after they already written a fairly large Rust project. Biggest surprises were that:
|
Having taught Rust multiple classes plus advising substantial number of projects, I noticed many, especially C++ developers undervalue the importance of
cargo fmt
, compiler warnings, and clippy warnings.I think it would be good to introduce good "Rust hygiene" practices early on, and make sure to stress the importance of them.
Important points:
cargo fmt
, and Rust developers expect the code to follow the same rulesfmt
on save (available in both VS Code and IntelliJ)cargo fmt
- if unhappy with the results, insert additional variables/statements to keep code easier to read#[allow(...)]
in the few edge cases.cargo clippy
to improve you Rust-foo.The text was updated successfully, but these errors were encountered: