Consistency as key to success

May 30, 2024

Consistency is key to success. We’ve all heard it, right? But how do you actually achieve it? I’ve found that having strong opinions and sticking to conventions is a great way to start.

One of the things I loved about Go from the beginning was its built-in formatter, gofmt. It seems I’m not alone because Rust and Deno have similar tools.

Why does this matter? Well, I’ve seen countless hours wasted on arguing about tabs vs spaces (seriously, people?), where curly braces should go, and how to write git commit messages.

Ain’t nobody got time for that!

Take a look at this commit . It’s supposed to remove a <div>, but the real change is buried among ' becoming " and other style changes.

This doesn’t apply to coding though, it can be a philosophy for every little decision you make during your day.

We want consistency, and conventions give us that. As Steph Ango puts it , “Every time you reuse your style you save time.”

So, what can you do?

  • Use built-in conventions: If your tools have them, great! Use them.
  • Borrow from others: No built-in conventions? Look online for similar projects and see how they do things.
  • For companies: Have someone gather ideas, define the conventions, and document them. This avoids endless debates.
  • Go the extra mile: Build a simple tool to check if everyone is following the conventions. It helps newbies learn the ropes too.

Important note: Don’t let conventions become a straitjacket. Make exceptions when needed. And if there are too many exceptions, it’s time to change the convention. They’re not set in stone.