Ask HN: It's 2018, tabs or spaces?

8 points by dvh ↗ HN

11 comments

[ 3.4 ms ] story [ 16.8 ms ] thread
Spaces, now and forever.
Spaces. Tabs are invisible and mess stuff up if mixed with spaces.
Spaces. Your editor should convert the tab key to spaces.
tabs, so everyone can choose their own display width
Both. Tabs for indents. Spaces for alignments after the indent level is reached.

Everyone can view code with their preferred indent width. Perfect solution with no flaws or drawbacks. Maybe 1 drawback, it requires advanced tooling (emacs smart-tabs-mode) to automatically handle the indentation/alignment.

Indent width is a visual effect. Mandating an indent width with hard spaces is like mandating the color scheme.

Whatever the rest of the team uses. For personal projects: whatever is idiomatic for that language.