Skip to content

Coding Standards

Navheen edited this page Jul 27, 2025 · 2 revisions

General Guidelines

  • Follow the project's established style guide.
  • Write clean, modular, and well-structured code.
  • Keep functions and classes small and focused on a single responsibility.
  • Avoid hardcoded values as much as possible; use constants and configuration files instead.
  • Maintain consistency in naming conventions and code structure.

Naming Conventions

  • Use camelCase for variables and function names (fetchHaiku).
  • Use PascalCase for class and component names (Home).
  • Use meaningful and descriptive names that reflect the purpose of the variable or function.

Formatting & Style

  • Use proper indentation (e.g., 2 spaces for JavaScript, 4 spaces for Python).
  • Use blank lines to separate logical sections of code.

Code Structure & Organization

  • Group related functions and classes into appropriate modules.
  • Keep related files together and follow a logical folder structure.

Error Handling

  • Provide meaningful error messages and log errors where appropriate.
  • Avoid silent failures and try to always return useful feedback.

Security Best Practices

  • Ensure that relevant files are included in the .gitignore.

Documentation

  • Include comments explaining complex logic.
  • Maintain up-to-date README and wiki documentation.
  • Use inline comments where necessary.

Clone this wiki locally