Skip to content

Coding style guides

A style guide defines rules and guidelines for how to structure and format your code. This can make code easier to write, because you don't need to worry about how to format your code. It can also make code easier to read, because consistent styling allows you to focus on the content.

There are two types of tools that can help you use a style guide:

  • A formatter formats your code to make it consistent with a specific style; and

  • A linter checks whether your code is consistent with a specific style.

Because programming languages can be very different from each other, style guides are usually defined for a single programming language.

Here we list some of the most widely-used style guides for several common programming languages: