Well, I created this document.
Code_Indentation_Tabs_Versus_Spaces.pdf
Took me longer to write than I expected, but I like the result.
Code Indentation: Tabs Versus Spaces
Re: Code Indentation: Tabs Versus Spaces
Interesting.
Are you planning similar documents about other aspects of coding style?
Btw, in the list of "programming languages that use whitespace to determine functionality" (last page), you should add Python.
I looked through the SDLPoP sources.
Indentation is mostly done using tabs, but there are a few places that use spaces.
I guess I should fix that.
Btw, the forum does something odd with tabs:
Each tab becomes 3 spaces.
Not a tab-stop at every third character position, but always 3 spaces.
Are you planning similar documents about other aspects of coding style?
Btw, in the list of "programming languages that use whitespace to determine functionality" (last page), you should add Python.
I looked through the SDLPoP sources.
Indentation is mostly done using tabs, but there are a few places that use spaces.
I guess I should fix that.
Btw, the forum does something odd with tabs:
Code: Select all
t
t t
tt t
ttt t
Not a tab-stop at every third character position, but always 3 spaces.
Re: Code Indentation: Tabs Versus Spaces
No, life's too short.David wrote:Are you planning similar documents about other aspects of coding style?
Not odd. Fixed tab stops are not (yet widely) used on the web. The tab-size CSS property, which does not yet work on mobile phones, also only specifies the "number of spaces in a tab" (source). So, "always [n] spaces" is their only option. (Regardless, they should just leave tabs alone.) Also, what you did will never work anyway. You used hard tabs for (mid-line) alignment. From the software's perspective, what you posted could've come from anywhere. Tab stop widths vary. What you posted only looks correct with tab stop width 4 and up. Paste it in an editor and set the tab stop to 2 or 3; you'll see your formatting breaks.David wrote:Btw, the forum does something odd with tabs:Each tab becomes 3 spaces.Code: Select all
t t t tt t ttt t
Not a tab-stop at every third character position, but always 3 spaces.
Re: Code Indentation: Tabs Versus Spaces
Ah, yes. So I inadvertently posted another argument against using tabs for alignment.Norbert wrote:Also, what you did will never work anyway. You used hard tabs for (mid-line) alignment.