Coding Style
To ensure your code looks consistent throughout your entire project, you should be following a coding style. The recommendation in this guide is to create your own coding style for a limited number of rules and to follow the generic coding style of the language you are using for everything not covered by your own coding style. Following your own coding style should be mandatory whilst following third-party coding styles should be at your discretion and decided on a case by case basis.
Tip
It is recommended to not create too many rules in your own coding style. Too many rules or a too restrictive coding style might hinder your development or may make it hard to follow your coding style 100% of the time.
Own Coding Style
For the development of Epic Fantasy Forge, we will follow the below five rules. Follow the default coding style of your programming language for anything not covered under these rules.
- Functions should not exceed 25 lines of code.
- Functions should take at most 2 parameters.
- Structs should have at most 5 fields.
- Files should have at most 5 functions.
- Files should have at most 2 structs.
Third-party Coding Styles
Third-party coding styles that may be followed by Epic Fantasy Forge in some instances include: