Skip to content
Donkey Development Guide
  • Pages
    • Project Overview
    • Workflows
      • Developer Flow
      • Adding New Features
      • Feature Requirements Document (Sample)
      • Syncing Design & Code
    • Design Guide
      • Style guide
      • Components
      • Exports
    • Coding guide
      • Folders structure
      • Coding Practices
        • Styling
      • Naming Practices
      • icon picker
        Commenting Practices
    • Github & Code Review Practices
    • Components
    • Resources

Commenting Practices

General commenting principles

Comment everything as clear as possible.
Write in a way that someone else can understand.
Don’t push anything before you comment it.
Don’t refer to other comments and so on. write a full detailed description.

What to comment

Head of files
Write down a brief what is the content and goal of each file / component.
Functions
Describe the purpose of the function, which parameters it accepts, and what output it generates at the top.
Data fetching
Describe what data is being called and from where.
Logic
When unobvious decisions were made describe why it is done this way and not the other.
Formating
Comments will be written in their own lines.
Comments will be always above the code they are commenting.
Comments will use the basic format of the file’s language (don’t add any other characters other then the basic format).

Examples

Formating
// This is a good comment formatting

////// This is a bad comment formatting

///*** This is really bad comment formatting ***///

 
Want to print your doc?
This is not the way.
Try clicking the ··· in the right corner or using a keyboard shortcut (
CtrlP
) instead.