Many development teams spend an inordinate amount of time arguing over styling and formatting preferences, such as:
- Whether to use single quotes or double quotes
- Whether curly braces go on the same line or the next line
- How to wrap long lines of code
Although these preferences are somewhat subjective, there's something to be said for consistency. Imagine you're reading a book where one page is double spaced and the next is single spaced. On one page, important terms are bolded, and on another page, important terms are underlined. As a reader, those types of inconsistencies can get between you and the content of the book. Likewise, in code, these types of styling and formatting preferences do make a difference.
Since styling comes up frequently during code reviews, it's a good idea to have a strategy in place for dealing with it. Here are three levels of maturity for dealing with code formatting on a development team.