Skip to content

Code Style

A code standard or style is a consistent, yet flexible, set of “best practices” designed to improve quality and readability while making code changes and maintenance easier. It:

  • encompasses all aspects of code construction
  • is designed to improve adaptation & maintenance
  • does not form an inflexible set of standards
  • is consistent
  • is not “one size fits all”
  • defines “best practices” for writing code
  • must adapt to changes

A code standard is a set of conventions (sometimes arbitrary) about how to write code in a project. It is much easier to understand a large codebase when all the code in it is in a consistent style.

By ensuring a code style in your project you will get the following benefits: readability, program structure, programming practices, correctness, portability/nteroperability, reusability, performance and globalization/localization.

If you are not sure where or how to start, there are plenty of work in the community around standards for most common languages, check it out here and here pick one and stick to it.

Once you and your team is onboard with the practice, don't forget to enforce your code standard in the daily basis. You can configure your IDE to automatically check for non-standard code, install add-ons and extensions, plug-in external tools in your CI/CD process and even check for it in your code review process.

Credits