Skip to content

[META] Writing a code style standard like PEP8 for Fortran #118

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

Open
Leonard-Reuter opened this issue Dec 17, 2019 · 5 comments
Open

[META] Writing a code style standard like PEP8 for Fortran #118

Leonard-Reuter opened this issue Dec 17, 2019 · 5 comments

Comments

@Leonard-Reuter
Copy link
Contributor

Leonard-Reuter commented Dec 17, 2019

Should we have a unified recommended code style standard like PEP8 for Fortran?
If there is constent, that this'd be helpful, I can open a repo for it.

I found the following repo browsing the internet:
Rules in 'Modern Fortran: Style and Usage' (Book)
http://fortranwiki.org/fortran/show/Source+conventions
https://www.fortran90.org/src/best-practices.html
https://github.com/kramer314/fortran-style-guide
https://github.com/compas/grasp/wiki/WIP:-Code-style-conventions

@gronki
Copy link

gronki commented Dec 17, 2019 via email

@Leonard-Reuter
Copy link
Contributor Author

Leonard-Reuter commented Dec 17, 2019

This is interesting. Could you elaborate more on this? What is this, who publishes it etc? I wonder if that would let off some pressure for "discouraging users from writing bad code" from the standarization entity. wt., 17 gru 2019 o 16:49 Libavius [email protected] napisał(a):

I just updated the original post with a link to pythons PEP8 and a few Fortran style guides I found in the internet.
Most Fortran projects have their own style guide (which may be useful, since requirements can differ). However it would be good to have a unified way of writing code and then making exceptions and breaking the rules.
This is especially helpful for beginners who then don't have to find rules themselves.
In a repo, everybody could discuss/share his*her ideas and contribute to a summary of rules.

@everythingfunctional
Copy link
Member

I would whole heartedly be in favor of this. In fact, I've put together style guides based on documents from NASA, JPL, Google, and PEP8, ProgrammingStandards.pdf. I've got several open source libraries out there in this style.

@nncarlson
Copy link

The guidelines in all style guides I've seen, including a couple linked here that I skimmed, fall mostly into two categories. One is "best practices", things like always use implicit none that have weighty rationale behind them. For these things I think it is possible to come to a broad community consensus, and believe a best practices guide would be extremely useful.
The other category is simple style, things like don't use CamelCase for names. Everyone has some rationale for what they choose, but in the end it really boils down to personal preference. Style guides seem to consist mostly of this stuff. It is important for individual projects, but trying for broad community consensus on these types of things would be a fools errand.

@septcolor
Copy link

septcolor commented Dec 28, 2019

Isn't the "coding style" discussion more suited to, for example, stdlib rather than a proposal for the standard...? Because they include actual working codes, beginners can learn much from their coding style.
https://github.com/fortran-lang/stdlib/issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants