Code Organization Recommendations #1157
average-gary
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Let consolidate on a code style that can be enforced (mostly) by a linter/formatter.
Some of my personal recommendations below:
Code Organization
structandimplBlocksimplblocks should be written immediately after the declaration of the respectivestructorenum.Avoid mixing
implblocks for different entities together. If they need to co-exist in the same file, they should be grouped logically in different regions of the file so the reader can easily find methods right next to the declaration of thestructorenumthey belong to.Enums
Alphabetize all enums and other "lists" of items
Variable Naming
Default to full variable names instead of abbreviations. Since we are not limited to line length in modern IDEs, we should not constrain readability by abbreviating variables. Short lambda functions are exceptions to be considered.
Beta Was this translation helpful? Give feedback.
All reactions