Code standrads - brightstudent/backend GitHub Wiki

Code standrads

Coding standards are used by good software development businesses to ensure that its programmers adhere to a well-defined and uniform style of coding. They frequently build their own coding standards and guidelines based on what works best for their business and the types of software they develop. It is critical for programmers to adhere to coding standards; otherwise, the code will be rejected during code review. This is also applicable for small group.

Coding standards are nothing but a collections of rules and guidelines that define a programming language's programming style, techniques, and methods.

The significance of coding conventions

Without coding rules, each member of a team will develop their own coding style. In the foreseeable future, maintaining and debugging the code will be difficult.

The Goal of Coding Standards:

  • A coding standard offers the programs developed by different people a consistent appearance.
  • It increases the readability and maintainability of the code while simultaneously reducing complexity.
  • It promotes code reuse and makes it easier to spot errors.
  • It fosters good programming methods and boosts development efficiency.

Linters can be used to make all of this achievable.

Common Coding Standard Aspects:

  • Naming conventions define how your packages, classes, methods, variables, and so on should be named. (For example, camelCase, PascalCase, or snake case)
  • Folder and file Naming and Organization: This is how you should name and organise your files and folders.
  • Indentation and formatting: The code should be written in a consistent format and indentation.
  • Commenting and documentation: This allows code reviewers to better comprehend your code's functions and declarations.
  • Classes and Functions: This defines the behavior of classes and functions.
  • Testing: This outlines the method and tools to be used to test the codes.