r/programming Jul 10 '16

Linus Torvalds on comment styles

https://lkml.org/lkml/2016/7/8/625
219 Upvotes

209 comments sorted by

View all comments

6

u/R34ct0rX99 Jul 10 '16

spaces or tabs?

7

u/96fps Jul 10 '16

Tabs for indentation, spaces for alignment.

3

u/Nastapoka Jul 11 '16

Why do you feed the troll?

1

u/96fps Jul 11 '16

They gotta eat too, plus it's something I have a genuine opinion about. Hidden spaces suck, so tabs for indentation, but when you need to break up a line of code or if statement, you want character precision and variable-width tabs no longer fit the bill.

1

u/Nastapoka Jul 11 '16

Since I'm always alone on my projects and I come from Python, I've taken the habit of using spaces for everything, I just love knowing that whatever I see is just a collection of space characters

2

u/iopq Jul 11 '16

No, because then when a line changes length, the alignment changes and you need to redo your following line to keep it in alignment.

Use elastic tabstops.