Fortran-FOSS-Programmers / Fortran-FOSS-Programmers/Best_Practices

What constitutes idiomatic Fortran?

Open
#12 12 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
No language data
Stars
70
Forks
10
PR merge metrics
No merged PRs in 30d

Description

I recently used the term "Fortran idioms" or possibly "idiomatic Fortran" on comp.lang.fortran and someone commented that they weren't sure such a thing exists, which makes me think that it should exist if it doesn't. I see the term "idiom" in discussions of common practices in other languages. I interpret it as being the common way one does things when she really knows the language's full range of capabilities and chooses the most powerful or succinct or transparent and expressive way to accomplish the goal. By comparison, there's a whole book on [writing idiomatic Python](https://www.jeffknupp.com/writing-idiomatic-python-ebook/).

I think of idiomatic Fortran as using things such as array constructors to do in one line what would require a loop in some other languages:

real, allocatable :: positive_integers(:)
positive_integers = [(i,i=1,100)]

Is there such a thing as idiomatic Fortran?

Would it be another reasonable name for "Best Practices"?

Are there other examples of practices you would consider to be natural idioms that an experienced Fortran programmer might use, but that a newcomer to the language -- especially one whose primary experience is in one of the other common scientific programming languages -- would likely do in a less elegant way?

Damian

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.