Skip to content

Code Style & Documentation

Code style

  • Follow the repository's established style; if none exists, use community standards.
  • Prefer self-documenting code over heavy commentary.
  • If a procedure is getting too long, reconsider the decomposition; the breakdown may be off.

When to comment

Add a docstring or comment when the logic is non-obvious or a design decision needs explanation.

API documentation

  • APIs must include proper docstring specifications so callers can understand usage without reading implementation.

Why this matters

APIs are consumed outside the context of their defining functions, so clear docs prevent misuse and regressions.