Re: On Tabs and Spaces
From: Sam Ravnborg <hidden>
Date: 2016-06-15 22:43:42
General comment about the <tab> versus spaces debate.
The root problem is stupid editors that does not show when a tab is used
and when spaces are used.
So people continue to mix tabs and spaces.
In linux people generally think that 8 aligned spaces equal a tab
which is IMHO stupid.
Tabs should be used for indent and not general alignment.
Consider:
<tab>if (some long condition that
<tab>....&& spans two lines) {
<tab><tab>my_private_printf("bla bla bla"
<tab><tab>.................."more bla bla\n");
<tab><tab>}
This will look good and align "more bla bla\n" as
intended no matter your tab setting.
But replacing the 8 spaces with a tab will
cause it to look bad.
And using tabs let me use the tabsetting I like (8) and other
use the tab setting they like (2,3,4,5,6,7) and all is good.
And why a tab is 8 spaces and in considered good.
Thats to teach people to write small independent functions
that does _one_ thing and does it well.
Mega functions with 6 times indent or more usually needs to
be breaked up anyway.
Sam