I've never really understood why you would use several characters (=spaces) for something that is semantically one indent. Can someone enlighten me? What are the advantages of spaces over tabs?
Tabs or spaces – Parsing a 1B files among 14 programming languages
31–40 of 124 posts
Re: Tabs or spaces – Parsing a 1B files among 14 programming languages
#32Now, can we look at the same repositories and look at the number of bugs and correlate it with the use of spaces? But in all seriousness, how often something is used isn't an indication of how good it is. Spaces are like cigarettes. Just don't start.
Re: Tabs or spaces – Parsing a 1B files among 14 programming languages
#33(Some potential storyline spoilers if you haven't seen Silicon Valley) https://youtu.be/SsoOG6ZeyUI
Re: Tabs or spaces – Parsing a 1B files among 14 programming languages
#34I wonder what else is different about these two groups.
Re: Tabs or spaces – Parsing a 1B files among 14 programming languages
#35My rationale:
The number of readers of any document will normally be greater than the number of authors. We should give a slight preference for readability and ease of comprehension over writeability, and should certainly not require that our readers adjust their editor settings for each document that they peruse.
In addition, it is useful to use vertical alignment to group related content that spans multiple lines. Although this at least partly an aesthetic choice, and not without drawbacks, I believe that the benefits outweigh the costs.
I believe that it looks neater, improves readability and also makes some errors "pop" out in a way that they don't in unaligned content. I find the ability to visually group related terms and expressions particularly useful.
The downside is that you have to "tidy up" after using refactoring tools or after doing a search-and-replace operation.
However, I believe that this downside is mitigated due to the fact that the very tidying up that is required is a good way of eyeballing the changes and checking to make sure that they are OK.
http://williamtpayne.blogspot.co.uk/2012/04/spaces-over-tabs...
Re: Tabs or spaces – Parsing a 1B files among 14 programming languages
#36Earlier quoted context omitted.
Most diff programs have an "ignore whitespace" option. "whitespace noise on diffs" is pretty much a solved problem. You can even add '?w=1' to a Github URL to turn on the feature.
1. That's a band-aid. The characters have still been changed - the diff still "exists". 2. Those options are not perfect, they don't always work as expected 3. Those options are not turned on by default (because that would be INSANE) 4. Git's not the only VCS, much as I wish it were 5. Github's not the only Git web UI; that option is not available everywhere. It's not a "solved problem". It's an artificial problem, t…
This is mostly solved via coding standards. If there are no coding standards people will "refactor" the coding style when they touch various pieces of code. If people were following a consistent style, then the alignment wouldn't be changing all of the time.
Although I strongly agree with the trailing whitespace sentiment. The most egregious offender that I've found is Eclipse putting trailing spaces on blank lines to bring them to the indent level of the non-blank lines. Ugh.
Re: Tabs or spaces – Parsing a 1B files among 14 programming languages
#37I've never really understood why you would use several characters (=spaces) for something that is semantically one indent. Can someone enlighten me? What are the advantages of spaces over tabs?
def doSomething( parameter1 , parameter2 , parameter3 ): pass How would you make all the punctuation line up using tabs?
Re: Tabs or spaces – Parsing a 1B files among 14 programming languages
#38I've never really understood why you would use several characters (=spaces) for something that is semantically one indent. Can someone enlighten me? What are the advantages of spaces over tabs?
* Use different tools - IDE, command line, version control tool, code review tool, e-mail client.
* Have code that follows with different conventions - because you participate in several projects, or because you've imported third party code that follows a different convention, or because the code is written in different languages.
* Have co-workers with different opinions about what tab width should be set to.
Personally I don't think there's that much value in vertically aligning things, except in lookup tables. Usually it's a sign you've adopted line-length rules that don't reflect modern monitor sizes, or that your methods have too many parameters. But some people seem to think it's valuable.
Re: Tabs or spaces – Parsing a 1B files among 14 programming languages
#39Re: Tabs or spaces – Parsing a 1B files among 14 programming languages
#40Obligatory clip from Silicon Valley (Season 3): Tabs vs Spaces (Some potential storyline spoilers if you haven't seen Silicon Valley) https://youtu.be/SsoOG6ZeyUI