- Code should aim for simplicity, readability, and fewer errors, rather than optimizing for performance or line count.
- Minimize the use of if-else statements, and avoid excessive nesting levels (not exceeding 3 levels).
- Return early when encountering errors; for Options, prefer using ok_or to transform them into readable errors and return early.
- Dependencies should be uniformly defined in the workspace and referenced in crates using workspace = true.
- Avoid specifying fixed versions for dependencies; specify up to the minor version but not the patch level.
- Prioritize code reusability by writing functions and traits instead of copy-pasting.
- Each module should properly define its exported types, functions, etc., and external imports should use "use modName::*;" rather than importing each item individually with 100 lines of imports.
- Don't over-comment; express intent through function and variable names, and add comments only where necessary - not every place needs a comment as that would reduce readability.
- Tests should be in the same file as the code whenever possible, avoid creating too many tests directories.
-
Notifications
You must be signed in to change notification settings - Fork 0
Psy Language Compiler
License
PsyProtocol/psy-compiler
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
About
Psy Language Compiler
License
Contributing
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published