
This topic is the answer to the topic "
It's time to use tabs in code ".
I wanted to respond to comments, but due to the volume and the desire for independence from the source topic I decided to create a new topic.
So, under the cut - why tabs are better than spaces, the most significant misconceptions about tabs and how to use them correctly.
')
Let's start with the fact that
most people (at least on Habré) prefer tabs.
The link is a very cool comment from
GreyCat :
In fact, it is strange that many still do not distinguish indentation and alignment. Well, here it is - indentation:
for (int i = 0; i < 10; i++) {
if (a[i] == 0)
do_something(i);
}
— alignment:
int some_variable = 0;
int v1 = 0;
, , — indent' . — .
IDE Smart Tabs :

( — indentation) — .
2 :

5 :

9 :

?
1. .
. — , — .
2. . - , - . .
:
, , . , 3 , 4 . 2 . - .
, — , - , .. tab ( IDE ). , , , - .
. 4 . - - - , . , - .
, — . , . — 2, 10 .
. . . , - .
, Kate, - - . , . . — . , . .
, , . , . - .
, , .
, ( , ), ( 3 4, ), .
, ( ) .
, . ,
. /, , , - .
UPD:
. « VS », , . , indentation alignment. , , . , , .
— . . — « », .
, , , , - .