Skip to content

coding guidelines

slammingprogramming edited this page Jun 25, 2023 · 1 revision

Coding Guidelines

To maintain a consistent and readable codebase, please follow these coding guidelines when contributing to Pong Unleashed:

Code Style

  • Use PEP 8 as the base style guide for Python code.
  • Use clear and descriptive variable, function, and class names.
  • Use proper indentation with 4 spaces for each level.
  • Limit line length to 79 characters.
  • Write comments to explain complex logic or provide necessary context.

Documentation

  • Document your code using meaningful comments.
  • Provide clear and concise docstrings for functions, classes, and modules.
  • Document any public interfaces, classes, and functions.
  • Explain the purpose and usage of the code.

Modularity and Reusability

  • Write code that is modular and follows the principles of separation of concerns.
  • Break down complex tasks into smaller, reusable functions or classes.
  • Avoid repetitive code and favor reusability.

Testing

  • Write unit tests to validate the functionality of your code.
  • Ensure your changes do not break existing tests.
  • Test edge cases and handle potential exceptions.

Git Best Practices

  • Make frequent commits with clear and descriptive commit messages.
  • Use meaningful branch names that reflect the purpose of the changes.
  • Keep your branches up to date with the latest changes from the main branch.
  • Before submitting a pull request, rebase your branch to incorporate the latest changes.

By following these coding guidelines, we can maintain a clean and consistent codebase for Pong Unleashed. Thank you for your contribution!

Pong Unleashed Coding Guidelines

Clone this wiki locally