Hacker News new | ask | show | jobs
by masklinn 3898 days ago
> But, that's arguing two points, right?

No?

> Sure, it's technically the right distinction, but it's not practical in any reality in which we live.

It's not practical to do by hand (because most people can't be arsed to configure their editor to do it, or their editor is incapable of it in the first place), why would it not be practical when a tool takes care of it for you and everybody uses that tool?

> Trying to say "alignment" is distinct from "indent" and that tabs and spaces can be mixed depending on your intention is just crazy talk.

And yet gofmt seems to work.

> The only place tabs should be used is in Makefiles, and Makefiles should be autogenerated by CMake these days, never written by hand.

Why? If the distinction between indentation and alignment can be made and can be made correctly, it means anyone can pick the tabwidth they prefer and things will just look right for everybody, that's strictly superior to either tabs or spaces. That's been advocated for decades, it just doesn't work when you leave it to people, which gofmt doesn't.

I'm quite far from a go fan, but achieving the ideal of "tabs for indentation, spaces for alignment" is definitely praiseworthy, whatever you think of other formatting rules.