September 28, 2018
About three years ago, I was involved in the most heated argument I’ve experienced thus far in my career. I wish I could say it was about something important with long-term consequences, like a decision about which data store or framework to use. Nope. It was about code formatting. Specifically, the argument was about tabs vs spaces in a spectacle that was a little too similar to a scene from Silicon Valley.
Everyone I’ve worked with agrees that code should follow a consistent style. It’s easy to set up a linter that will fail your CI build when these styles aren’t being followed. But standard linters fail to accomplish two things that I’ve always viewed as necessary evils when programming with a team: deciding on styles, and following them.
My world was rocked when my team started using Prettier. Prettier is an opinionated code formatter. It automatically formats your code based on styles that the creators of the tool have decided upon.... Read more