Comments (4)
Modern, FREE form.
It sounds like we should (if we can) enforce whatever minimal set of things that seem reasonable per modern, free form sensibilities here in the repository. For the people working through the track we should probably summarize what you wrote here: no broad consensus, some great suggestions, we recommend tending towards the modern style.
from fortran.
Still searching on linting for Fortran. There's nothing that I can tell that's inbuilt (other than the compiler itself), but there may be open source tools that can help here.
Style-wise, we'll likely stick to f90, free-form (vs. fixed), and a consistent spacing (probably 2 or 4 space indentation).
from fortran.
If there's no particular suggested library / best practice, I tend to recommend sticking with whatever small set of rules that seem to make sense. Your style-wise list sounds like a totally reasonable place to start.
from fortran.
Is there a style guide for Fortran?
No formalized or completely agreed upon convention. Some books have great suggestions though, like:
- @rouson's Scientific Software Design: The Object Oriented Way
- Modern Fortran
- Modern Fortran Explained (This doesn't really have style recommendations, but it is the defacto language reference and teaching book)
We sort of have a living document/discussion about "Best practices" at Fortran F/OSS Programmers: https://github.com/Fortran-FOSS-Programmers/Best_Practices. Also, Stefano, AKA @szahgi has one at: https://github.com/szaghi/zen-of-fortran
Here's yet another style guide: https://github.com/kramer314/fortran-style-guide
Are these styles encouraged or enforced?
Encourages... nothing is enforced. Tons of people still write in fixed format F77 😭
Are there any conventions that we should adopt on this track for the sake of consistency?
Modern, FREE form. I prefer 2 space indentation, but 4 is fine too. JUST DON'T USE TABS lol, no I'm not sure it matters, but I do need to go have a look at the standard again to see whether or not they are explicitly prohibited. I don't think they are but need to double check.
There are two tools that can do some style manipulation:
- https://github.com/pseewald/fprettify
- https://github.com/wvermin/findent
- https://github.com/dev-zero/f90-formatter
I haven't used them much.
Can we enforce these?
W/ GFortran you can get some style checking and linting with: -std=f2008 -W -Wall -Wextra -pedantic
Is there a linter? Are there many? Should we use one?
There are no good Free linters that I know of. The only one I can find that seems somewhat reasonable is https://github.com/ratnania/fortlint
Is there a common convention for filenames? If not, what should our convention be?
Standard is .f90
for free format and .f
for fixed (or .F90
for files that need preprocessing, and .F
for fixed files that need pre-processing. Unfortunately, however, there is not standardized pre-processor, so we should avoid all pre-processing.) Some people use .f03
or .f95
etc. but this enrages most other Fortran programmers.
from fortran.
Related Issues (20)
- Add language blurb HOT 1
- Add 6 more exercises to have 20 exercises HOT 5
- Simplify CI/CD HOT 1
- Test runner needs correctly formatted output from TesterMain HOT 1
- Extract track-specific help instructions from `config/exercise_readme.go.tmpl`
- Extract track-specific test instructions from `config/exercise_readme.go.tmpl`
- TesterLib writes expected_results.json wrong.
- Fix lint issue
- Build analyzer
- Check docs are up to date HOT 1
- Add task id to json output HOT 1
- Issues with matrix exercise HOT 4
- CI (Linux) failing because no more `ubuntu-16.04`
- ABOUT Fortran page HOT 1
- Windows Build has several of the exercise tests failing HOT 3
- Errors in exercises CMakeLists.txt HOT 2
- Use latest version of test module in editor
- Building a training set of tags for fortran HOT 21
- Update status of Concept Exercises HOT 1
- Launch Tracker 🔴 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fortran.