From the course: Agile Software Development: Code Quality

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Why consistent coding style?

Why consistent coding style? - SonarQube Tutorial

From the course: Agile Software Development: Code Quality

Start my 1-month free trial

Why consistent coding style?

- [Instructor] We make a lot of stylistic choices when we're crafting source code. Tabs or spaces? Curly braces at the end of the line or on their own line? Limit lines to 80 characters or accept more than that? Ultimately, those choices minimally affect the readability of your code. What matters is that the style you choose is consistent throughout. For example, a file which mixes tabs and spaces for indentation is going to cause confusion. Being consistent with these choices is fairly easy when you're working by yourself, but not seamless with a team. This is because stylistic choices are very personal and there might be team members who feel very strongly that their preferred choice is the only correct one. I've worked on many teams that have solved this issue by writing a detailed style guide to document the team's preferred style. Looking for examples? GitHub, Google, Airbnb have style guides that you can find online. There are also style guides that are maintained by different…

Contents