Gallery
Donkey Development Guide
Share
Explore
Coding guide

icon picker
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 ***///

Share
 
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.