The Sacalon Style
Whitespace
- One statement per line.
- Use spaces instead of hardware tabs.
- Each indentation level will be four columns.
Naming Conventions
Unless listedVariable names should be camelCased. So, names formed by joining multiple words have each word other than the first word capitalized. Also Function names should be split with an underscore(`_`).
Module and package names should be all lowercase, and only contain the characters [a..z][0..9][_]. This avoids problems when dealing with case-insensitive file systems.
The names of user-defined types should be PascalCased, which is the same as camelCased except that the first letter is uppercase.
The names of constants should be CAPITALCASED.
If a name would conflict with a keyword, and it is desirable to use the keyword rather than pick a different name, a single underscore ‘_’ should be appended to it. Names should not be capitalized differently in order to avoid conflicting with keywords.
Variable Declaration
Always assign a value to variables when you declare they and decrease using nullable variable in your program.
Imports
- Local imports should be preferred over global imports.
- Imports should be sorted lexicographically.
We are not necessarily recommending that all code follow these rules but sent PRs to Sacalon standard library should should use these rules.
Do you have a suggestion to improve these rules or an idea for new rules? open an issue on Sacalon's github repository.