2026-03-23 20:06 UTC
I've been organizing my lessons learned in writing readable code as a Rust Style Guide: https://epage.github.io/dev/rust-style/
This is more for organizing my thoughts and maybe having to reference back to when discussing how to improve the readability of code and not something where every items needs to be strictly enforced. I also suspect I could put more time into the motivations for some of the items. Even then, I expect not everyone will agree with every point.
Any principles or practices you've found that makes code more readable that I might have overlooked?
#rustlang
Replies (3)
-
@epage@hachyderm.io 2026-03-24 13:50
Apparently, this is also being discussed at https://lobste.rs/s/msgigh/guideline_rust_style
-
@epage@hachyderm.io 2026-03-27 17:37
I'm now following that up with one for contributing to projects: https://epage.github.io/dev/pr-style/
-
@diondokter@fosstodon.org 2026-03-23 20:40
@epage cool, nice writeup! I'll say that I wouldn't like this style to be enforced on the code I produce. Some of the item ordering stuff seems a little too strict to me and I have slight disagreements. I also think it's fine for lib and mod to contain more than just reexports, within some definition of reason of course. But I'd definitely accept PRs like this into my codebases! It's not too far off from what I naturally already do