-
Notifications
You must be signed in to change notification settings - Fork 187
Let's use 4 spaces instead of 2 #57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I think most people agreed to use 4 spaces instead of just 2.
@certik you need to change I list the reasons why I changed it back to 2 below, but if you want 4 that's fine by me. EDIT: A bunch more people have weighed in on this thread so the results listed below are essentially moot, it looks like we're going with 4 spaces. 🎉 Preferences (from #3):
3 preferences for 2 spaces and 3 for 4 spaces. Further considerations from #3My further understanding from #3 was that a consensus was reached by the majority that:
Given the concerns about line length when indenting procedure bodies etc. and the effective tie in preference for 2 vs 4 combined that 2 is the default for We should pick a convention and finalize this decision so people can sink their teeth into writing some code. Setting up editorconfig for per-project style/indentationAlso, a note for @certik and other vim users: If you install the vim editorconfig plugin you won't have to mess with your global preferences. It will/should use the indentation specified in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to make this change, please edit .editorconfig
too
Ugh.
wt., 31 gru 2019, 18:40 użytkownik zbeekman <notifications@github.com>
napisał:
… ***@***.**** requested changes on this pull request.
If you want to make this change, please edit .editorconfig
<https://github.com/fortran-lang/stdlib/blob/master/.editorconfig> too
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#57?email_source=notifications&email_token=AC4NA3PANOA6BIQMKMMYMV3Q3N72TA5CNFSM4KBW3DS2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCQOKICQ#pullrequestreview-337421322>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC4NA3OPG3PVAO3COUCYEWLQ3N72TANCNFSM4KBW3DSQ>
.
|
The survey is too small and not representative. Can you please list here the number of spaces used by the top 30 or more projects listed at:
https://github.com/fortran-lang/stdlib/wiki/List-of-popular-open-source-Fortran-projects
? That would be a lot more representative what the community at large uses.
…On Tue, Dec 31, 2019, at 10:40 AM, zbeekman wrote:
@certik <https://github.com/certik> you need to change `.editorconfig`
<https://github.com/fortran-lang/stdlib/blob/master/.editorconfig> too!
I list the reasons why I changed it back to 2 below, but if you want 4
that's fine by me.
Preferences (from #3 <#3>):
* @zbeekman <https://github.com/zbeekman>: 2
* @milancurcic <https://github.com/milancurcic> 2
* @jvdp1 <https://github.com/jvdp1> 1 or 2
* @longb <https://github.com/longb> don't care
* @gronki <https://github.com/gronki> don't care
* @certik <https://github.com/certik> 4
* @ivan-pi <https://github.com/ivan-pi> 4
* @marshallward <https://github.com/marshallward> 4
*3* preferences for 2 spaces and *3* for 4 spaces.
So, as you can see there is effectively a tie.
Further considerations from #3 <#3>
My further understanding from #3
<#3> was that a consensus
was reached by the majority that:
* module, submodule and program units should be indented
* procedure, type and interface bodies should be indented
* usual control constructs should be indented
* should strive to stay within 80 chars, with a hard limit of 132
Given the concerns about line length when indenting procedure bodies
etc. and the effective tie in preference for 2 vs 4 combined that 2 is
the default for `findent` I thought it prudent to switch to 2. However,
I may have misinterpreted or overstated the consensus reached on the
other bullet points above.
We should pick a convention and finalize this decision so people can
sink their teeth into writing some code.
Setting up editorconfig for per-project style/indentation
Also, a note for @certik <https://github.com/certik> and other vim
users: If you install the vim editorconfig plugin
<https://github.com/editorconfig/editorconfig-vim#readme> you won't
have to mess with your global preferences. It will/should use the
indentation specified in `.editorconfig`
<https://github.com/fortran-lang/stdlib/blob/master/.editorconfig> when
working on files for stdlib, and then your default when not. Many/most
editors respect `.editorconfig` out of the box
<https://editorconfig.org/#download>, and plugins for others, like
Emacs <https://github.com/editorconfig/editorconfig-emacs#readme> are
easily installed.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#57?email_source=notifications&email_token=AAAFAWDJANWVAHVFXIK6NZ3Q3N7XFA5CNFSM4KBW3DS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEH4PPDA#issuecomment-569964428>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAAFAWCNHI2LFRRM7FSLDCTQ3N7XFANCNFSM4KBW3DSQ>.
|
Considering the development here, I change my preference to "don't care". :) I'd also approve of allowing both 2 and 4 spaces, not mixed together within a source file. |
I vote for 4 spaces! :) |
I was only responding to your comment at the top of the PR and providing a rationale and evidence in support of my past decision:
I'm fine with either. Listing the number of spaces used by the top Fortran projects is not a good use of my time. The biggest one, OpenBLAS, appears to use 3 spaces FWIW. A final note before I completely abstain from further comment on indentation: Just because a library is big and popular doesn't mean we want to do what they did; tradition for tradition's sake alone isn't a compelling reason to do something! (If it were we'd all be writing F77 still.) Ah, thank goodness, @jacobwilliams broke the tie!!! Haha. Yes, please god let us use 4 spaces, just make sure that |
@gronki Please, please if you don't have anything constructive to add to the thread, just don't post. This is a good example of the kind of communication that isn't helpful. Please read Code of Conduct if you haven't yet. |
Let's change my preference from |
Just FWIW, here are some indentation used by the standard libraries of some other languages (which I think may be more or less related to numerical computing). 4 spaces:
2 spaces:
(I haven't checked other languages like JS, C#, Java, etc). So the choice seems to vary. I personally use 4 spaces for distinguishing block structures more clearly, but also feel that codes with 2 spaces are more compact. (I used 3 spaces for Fortran77, which was the default of Emacs at that time...) |
I know the Code of Conduct, what I basically meant is that it doesn't matter in my opinion considering the amount of decisions that have to be made that do matter. If you find my comments not constructive I think it's time from my side to move away to where I can actually help. |
I'll open a PR to change back to 4 spaces, and fix |
Thanks. I was addressing this specific comment and not your other posts, many of them helpful. Clean and constructive communication is important. |
I am away from my computer. Please close this PR I am retracting it. Let's spend our time constructively.
Let's submit a PR removing the requirement for 2 spaces. Or change it to 2 or 4 spaces.
Let's not lose any more time with this.
We have bigger fish to fry.
…On Tue, Dec 31, 2019, at 11:59 AM, Milan Curcic wrote:
Thanks. I was addressing this specific comment and not your other
posts, many of them helpful. Clean and constructive communication is
important.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#57?email_source=notifications&email_token=AAAFAWHNLNJTDQEJIE7UGMTQ3OJBFA5CNFSM4KBW3DS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEH4SBEQ#issuecomment-569974930>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAAFAWF4YCNLT3VBHI5CSULQ3OJBFANCNFSM4KBW3DSQ>.
|
Honestly I think everyone is fine with 4 at this point. I'll change the text to 2 or 4 if you prefer, but I'd rather pick one (4) that can be automated in hooks and checked in PRs. |
normally I prefer 2 spaces for Fortran projects, where the procedures are often longer than ideal. Since this is a fresh project, there may be more consciousness of procedure cyclomatic complexity. Thus 4 spaces would be less likely to result in excessive indentation->too much line continuation. |
@zbeekman and I talked about this on the phone. We can either choose now, or postpone this decision for later. We both prefer to decide now, because that allows us to setup automatic formatting at the CI, and move on. So we both agreed to make a choice now, see how it works for us, and we can revisit later if needed. Then the question is whether to choose 2 or 4 spaces today. We agreed to go with 4. |
I think most people agreed to use 4 spaces instead of just 2.