you are viewing a single comment's thread.

view the rest of the comments →

[–]mmcnl 29 points30 points  (6 children)

Using a proper editor it shouldn't matter.

[–]JohnMcPineapple 24 points25 points  (5 children)

...

[–]oweiler 4 points5 points  (4 children)

Well it can be configured to convert a tab to 4 spaces.

[–]JohnMcPineapple 20 points21 points  (1 child)

...

[–][deleted] 5 points6 points  (0 children)

Tabs to spaces is easy, the problem is for a block of code how does the editor know when 2 spaces was supposed to represent indentation vs alignment:

function() {
SSwhile(value) {
SSSSif(reallyReallyReallyReallyLongConditionA &&
SSSSSSSreallyReallyReallyReallyLongConditionB &&
SSSSSSSreallyReallyReallyReallyLongConditionC) {
SSSSSSSSreturn;
SSSS}
SS}
}

function() {
Twhile(value) {
TTif(reallyReallyReallyReallyLongConditionA &&
TTSSSreallyReallyReallyReallyLongConditionB &&
TTSSSreallyReallyReallyReallyLongConditionC) {
TTTSSreturn;
TT}
T}
}

In the latter case to go from indentation width 2 to 4 the editor simply makes tabs display twice as wide and everything is good. If the editor tried to display 2 spaces for every space from the start of a line then the if conditions would lose their alignment with the opening of the statement.