Welcome to the NGcodeX community! To maintain a consistent and high-quality codebase, we have established the following coding standards. When contributing to NGcodeX projects, please adhere to these guidelines:
- Write code that is clear, readable, and maintainable.
- Follow the principle of least astonishment - code should behave as expected.
- Keep functions and methods focused on a single responsibility.
- Use meaningful and descriptive names for variables, functions, and classes.
- Follow camelCase for variables and functions, and PascalCase for classes.
- Use consistent indentation (spaces or tabs) throughout the codebase.
- Follow a consistent line length, typically 80-120 characters per line.
- Configure your editor to use consistent formatting settings.
- Provide clear and concise documentation for all code.
- Include comments for complex logic or where clarity is needed.
- Keep documentation up-to-date with the code changes.
- Use comments sparingly and only when necessary.
- Write comments in clear English, explaining the why and not just the what.
- Avoid redundant comments that duplicate the code.
- Implement proper error handling to gracefully handle unexpected situations.
- Log errors with sufficient information to aid in debugging.
- Write comprehensive tests for your code.
- Ensure that tests cover both normal and edge cases.
- Run tests locally before submitting a pull request.
By contributing to NGcodeX, you agree to follow these coding standards. Consistency in coding practices helps maintain a healthy and collaborative community.
Note: NGcodeX reserves the right to update and modify these coding standards as needed. Contributors will be notified of any significant changes.