Tabs vs. Spaces

Tabs or spaces? I like to ask this cliché question during technical interviews.

How would you answer?

Most people nerviously laugh, and then try to lightly defend tabs, hoping I’m not a spaces guy. Or the other way around.

The truth is, I don’t care about tabs or spaces (although spaces are clearly superior!)

In my book, the correct answer is, “Don’t argue about it. Use a linter.”

This, and so many other style debates, are just a waste of time. Use a tool to enforce a style. Put it in your CI pipeline. Then never think about, or talk about it again. (And don’t worry if you actually like the style, either.)

The Go language is somewhat famous for its stance on this issue. It’s been codified as a Go Proverb:

Gofmt’s style is no one’s favorite, yet gofmt is everyone’s favorite.
— Rob Pike

Share this