Skip to content

Latest commit

 

History

History
61 lines (40 loc) · 2.18 KB

coding-standards.md

File metadata and controls

61 lines (40 loc) · 2.18 KB

NGcodeX Community: Coding Standards

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:

Table of Contents

  1. General Principles
  2. Naming Conventions
  3. Code Formatting
  4. Documentation
  5. Comments
  6. Error Handling
  7. Testing

1. General Principles

  • 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.

2. Naming Conventions

  • Use meaningful and descriptive names for variables, functions, and classes.
  • Follow camelCase for variables and functions, and PascalCase for classes.

3. Code Formatting

  • 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.

4. Documentation

  • 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.

5. Comments

  • 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.

6. Error Handling

  • Implement proper error handling to gracefully handle unexpected situations.
  • Log errors with sufficient information to aid in debugging.

7. Testing

  • Write comprehensive tests for your code.
  • Ensure that tests cover both normal and edge cases.
  • Run tests locally before submitting a pull request.

Acknowledgement

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.