Skip to content

Latest commit

 

History

History
31 lines (21 loc) · 1.36 KB

naming-conventions-code.md

File metadata and controls

31 lines (21 loc) · 1.36 KB

Naming Conventions

This document will serve as a guide for naming conventions in code to assist in following best practices and help bring uniformity to the code produced by different resource persons on the group.

Longer meaningful names are preferred in comparison to short lesser meaningful names. However, coping and pasting the (class / method / variable) names is advised to avoid spelling mistakes.

In writing comments, the guidelines by Pydoc / Javadoc should be followed to help generate documentation for the code.

Utilize whitespace to improve code readability

Class

  • A new document
  • Same name as name of the document
  • Using a name that reflects the purpose of the class
  • Starting with block comments (A brief overview of the purpose of this class, initials of the developer)

Functions

  • Using consistent style in naming methods
  • Using a meaningful name for a method that reflects its purpose
  • Using smaller methods to do only one specific task for high usability
  • Passing most of the decision cases to the method to generalize
  • Block comments presenting short description of the function, type and purpose of input parameters and the return type.

Variables

  • A name that clearly conveys its purpose
  • Avoid different type of values to the same variable

Change Log (for later updates)

  • When, who changed, what to fix which problem.