Skip to content

Latest commit

 

History

History
58 lines (40 loc) · 2.19 KB

Coding Standards.md

File metadata and controls

58 lines (40 loc) · 2.19 KB

Table of contents:

  • Code Structure

  • Variable Naming

  • Code Reusability

  • File Header Comments

  • Package and Class Comments

  • Annotations and Formatting

  • Method Comments and Documentation

  • Exception Handling

  • Code Structure:

    • Organize code logically into packages, classes, and methods.
    • Avoid large methods; break them into smaller, focused functions.(One function for the single method)
  • Variable Naming:

    • Use meaningful and descriptive variable names.
    • Follow a consistent naming convention (e.g., camelCase).
  • Code Reusability:

    • Promote code reusability by creating utility classes or methods.
    • Avoid duplicating code; favor modular and reusable components.
  • File Header Comments:

    • Each file should begin with a comprehensive header comment block.
    • Copyright information, license details, and a brief description of the purpose of the file.
    • The SPDX-License-Identifier should specify the license type.
  • Package and Class Comments:

    • Each Java package and class should have a descriptive comment.
    • Clearly state the purpose and functionality of the package or class.
  • Annotations and Formatting:

    • Use meaningful annotations for code clarity (e.g., @Entity, @Table).
    • Follow a consistent indentation and formatting style to enhance code readability.
  • Method Comments and Documentation:

    • Use descriptive method names.
    • Avoid methods with more than one function.
  • Exception Handling:

    • Implement appropriate exception handling where necessary.
    • Clearly state exceptions thrown and their potential causes.

NOTICE

This work is licensed under the Apache-2.0.