Modified all files to use spaces instead of tabs.#197
Modified all files to use spaces instead of tabs.#197jsundquist wants to merge 1 commit intoOpenF2:1.4-wipfrom
Conversation
|
We can make a decision to change F2's whitespace characters from tabs to spaces, but as it is this PR violates the current contribution guidelines.
|
|
Following-up after seeing the full context from Twitter. Thanks for taking the time to make the modifications and we'll consider whether it makes sense to change. |
|
Thanks @jsundquist. I missed your comment on going with 4 spaces — what is the thinking around 2 spaces vs 4? I think 2 spaces is what the cool kids are doing. |
|
@markhealey I personally prefer four spaces over two spaces. I don't think code is as easy to read and follow with only two spaces. A standard tab character used to be either four or eight depending on the system you were using, I believe this is why most people default to using four characters. |
|
I've reviewed this, looks good overall. @jsundquist whatever method you used to convert to spaces did some weird things with curly braces and expanding/flattening some function definitions and statements in the @montlebalm we can update the contrib guidelines. Any objections with merging? |
|
I imagine there are a variety of personal opinions on whitespace among the core contributors. There's no technical reason to change, so if we do it we should adopt a common style. Here's what I found googling for "javascript style guide":
I can't recommend switching F2 to 4 spaces given that it doesn't appear to be widely used in the community. Based on what I've seen, I'd argue for no change or 2 spaces. |
|
@jsundquist thoughts? |
|
Coming from the php community, our standards have been set to four spaces and I believe this is because a standard tab character is four spaces. Since they have set the standard to use spaces instead of the tab character, that would be my guess as to why they went with four space. That said, each community is different. Within this repository there is a mixture of tabs and spaces within a number of files. Also if you mix your html and javascript files they should all follow the same standard. I personally feel its easier to read indentation when you look at four characters than two characters, however I am open to either way. The argument that I would give for four spaces over two spaces is readability. With only two spaces you may have a difficult time trying to determine where a curly brace ends a for loop vs an if block within the loop depending on how large the block is. With four spaces you can get a little bit better definition. In some of the articles I just looked up, many people point out the main reason some of these companies went with two spaces over four spaces is so they can fit more characters within a given line if the line limit is set to 80 or 120 characters. Douglas Crockford actually suggests to use four spaces when working with JavaScript files. |
|
Good discussion here, thanks. Couple comments:
As a next step, we're going to close this PR because of #2 and #3 above. @jsundquist we'd be thrilled with a follow-up PR (again based on
Any files not included above are either auto-generated in a Grunt task or are 3rd party code. |
|
@markhealey Sounds great. I will see if I can find time to work on it later this week or next. |
|
Awesome thanks @jsundquist |
As discussed on twitter. I went through and updated all JS files to include 4 spaces instead of tabs. Also updated the html files as they were a mixture of four spaces, tabs, and 2 spaces. Lastly, updated the handlebar template files while I was at it to match everything else.