31.71 Flutter Style Comments

20230810

Make comments full sentences as traditionally understood, starting with capitals and ending with a full stop. There are reasons why over centuries we developed this style of writing sentences for effective and efficient communication. Let’s maintain that.

Encouraged

// A suite of functionality tests for the UI. Utilises integration_test.

Discouraged

// functionality test for UI utilises integration_test

Use blank lines to separate the narrative from the code. A blank line before and after a comment is good practise. The exception is at the beginning of a block which lint usually enforces.

Encouraged

String someCode = '';

// Functionality tests for UI.

String someOtherCode = '';

Discouraged

String someCode = '';

// Functionality tests for UI.
String someOtherCode = '';

Discouraged

String someCode = '';
// Functionality tests for UI.
String someOtherCode = '';


Your donation will support ongoing availability and give you access to the PDF version of this book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2022 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0