Remix.run Logo
bbkane a day ago

The most important thing is consistency. I've become a huge fan of deferring tabs vs. spaces debates to an autoformatter. Set it; forget it; argue about something else.

This is most useful when applied ecosystem wide - no one in the Go ecosystem argues about tabs vs spaces, they just run `go fmt` (or more likely their editor is set to do that automatically) and move the #$@% on with life :)

Fortunately for me, newer languages tend to include a formatter in the core install/editor tooling - Go, Rust, Gleam, Dart, probably more I'm forgetting... I think Go pioneered this approach and I'm glad others have taken it as well.

kevin_thibedeau a day ago | parent [-]

An autoformatter wont touch a tabbed ASCII diagram in the comments,

justinclift 17 hours ago | parent | next [-]

Go's autoformatter will absolutely screw up existing ascii comments when they randomly decide to change how the formatting works.

As found the hard way when one day we updated the version of the Go formatter, and much of our nice comments needed to be redone. Thanks Go formatter team (yes, that's being sarcastic).

arccy a day ago | parent | prev [-]

but the autoformatter will have dictated the choice of space vs tabs for the file in question, an likely also the width of tabs (if any) for alignment. so you just need to follow the convention.

kevin_thibedeau a day ago | parent [-]

The whole point of preferring tabs is so you can customize the display. That can't work if tabs are used in fixed format text.