by justWells on 1/18/21, 8:35 PM with 17 comments
by oxinabox on 1/18/21, 8:44 PM
The counter to this is people using spaces for alignment, Like if one wants to list arguements below the openning backet of a function call, and line up the closing bracket.
The counter counter is: stop that. Adopt a style guide that doesn't do alignment and sticks to a simple rule like "Always indent once while within a multiline expression" Alignment is for art. We don't have time for your subjective view of what makes code pretty.
by thesuperbigfrog on 1/18/21, 8:43 PM
If you are working on a team, do what the team does.
If you are working alone, do whatever works best for you.
by joshka on 1/18/21, 8:45 PM
by Jemaclus on 1/18/21, 8:58 PM
But more practically, I think the right thing to do is use an opinionated formatter (like Go's gofmt or similar) and enforce that across the teams that you work with. Life's too short to bicker about tabs vs spaces, when there are more important things to discuss like short variables vs long variables ;)
by necovek on 1/18/21, 9:10 PM
And I know tabs are seeing a comeback lately, but they are basically the only ASCII character that does not have a predefined width.
And the reason I dislike that is because they don't have clear semantics even in the pure text-only world: eg. writing out a table in ASCII is not possible with these "tabulating" characters, because if the column data is wider than (tab-width – 1), well, there goes your alignment. And when something is so badly defined not to serve the purpose it's named after, I can't like it. :)
If it was called the "indent" character which was ignored anywhere but at the start of the line, it would at least be sane and consistent.
Incidentally, Emacs can do the right thing in most modes by turning tab key into the (re)indent command.
by TheAnswerMan on 1/18/21, 9:45 PM
Everyone likes to take a dump on mixing tabs/spaces. But it solves all problems with both. Everyone can view the indentation width they prefer; 2, 3, 4, 8, whatever. And alignment is always correct no matter what width you prefer. An auto format tool can remove the need to manually deal with anything.
Indent width is a visual effect that should not be mandated. You wouldn't mandate a color scheme for your code base, so why would you mandate indentation width?
by jolmg on 1/18/21, 9:48 PM
> Eschew flamebait. Don't introduce flamewar topics unless you have something genuinely new to say. Avoid unrelated controversies and generic tangents.
by uberman on 1/18/21, 9:16 PM
by jjgreen on 1/18/21, 8:47 PM