Chat > Tech Chat
Spaces vs tabs for source code
sevenlayermuddle:
I've always had strong opinions on this, with a dislike of tabs in source code. Many of my colleagues used to agree. Finally a justification...
http://www.bbc.co.uk/news/technology-40302410
:)
roseway:
It never even occurred to me that this was an issue. I've always used spaces personally, and if asked for justification I would say that spaces are universal - so long as you use a monospace font, spaces will always look the same, in any editor. I suppose that one possible reason for the higher salaries is that higher-paying commissioning companies tend to require spaces to be used.
burakkucat:
Hmm . . .
Now in my 40th-plus year of writing source-code, I have always used a tab (with the conversion factor of eight spaces to one tab).
adrianw:
I actively wrote code for 48 years (gulp) and preferred spaces for any language that was usually indented to follow its structure.
sevenlayermuddle:
In the early days of my career I probably did use tabs, as it cut down down on file size. In those days each module would generally have only one author, so he/she could choose their own coding style. As long as it contained only tabs or spaces (not a combination) the code would still look neat to colleagues, except that the line length would differ if the viewer's tab stop preference differed from the author.
As time went by however, and modules became shared among multiple authors under shared source control a problem arose... some contributors would use spaces, some would use shorter tab stops, and some longer tab stops. That led to source code that looked pretty for nobody, other than the small area that fitted on a screen area that had been edited by the last contributor. :(
That said, the only code I have written in the past 6 years has been using Apple Xcode IDE's built editor, which does a fine job of auto-indenting. And do you know what, I have no idea whether it uses tabs or spaces. :-[
That said, the likelihood of anybody else ever needing to see my code is minimal, so maybe it is a return to days of old in a way. :)
Navigation
[0] Message Index
[#] Next page
Go to full version