This function can be auto-documented from its name and the names and types of its arguments alone. No ML required - simple pattern matching and LUTs will do. But then again, do you really need a detailed documentation in such case?
Where a documentation would actually be helpful are cases like this:
A format commonly found in the FORTRAN code of numeric libraries. If the author(s) didn't document this, an AI wouldn't stand a chance to know what it does.
PCHFE is Piecewise Cubic-Hermite Function Evaluation of course [1] and the parameters aren't exactly self-explanatory either...
Guessing !!
N,X, and F are probably related to NE,XE, and FE
"E" means "error"? Maybe.
IERR is an error flag. Idiomatic fortran there.
Each of those variables will be defined later on, in the code. at least with a type (not required, but it is not 1960 anymore). In that declaration is where some comments would be.
REAL*8 N ! Radius of the body in radians
Point being that fortran is not hopelessly opaque. A subroutine declaration is backed up with some more information.
(now if "implicit none" is not a requirement, then this all you get)
Love seeing some hard core numeric code. Precise and compact. No pointers, nothing sophisticated. Do loops, if statements, subroutine calls.
qayxc|5 years ago
Take this rather simple example:
This function can be auto-documented from its name and the names and types of its arguments alone. No ML required - simple pattern matching and LUTs will do. But then again, do you really need a detailed documentation in such case?Where a documentation would actually be helpful are cases like this:
A format commonly found in the FORTRAN code of numeric libraries. If the author(s) didn't document this, an AI wouldn't stand a chance to know what it does.PCHFE is Piecewise Cubic-Hermite Function Evaluation of course [1] and the parameters aren't exactly self-explanatory either...
[1] http://www.netlib.org/slatec/pchip/pchfe.f
bdavis__|5 years ago
Each of those variables will be defined later on, in the code. at least with a type (not required, but it is not 1960 anymore). In that declaration is where some comments would be.
Point being that fortran is not hopelessly opaque. A subroutine declaration is backed up with some more information.(now if "implicit none" is not a requirement, then this all you get)
Love seeing some hard core numeric code. Precise and compact. No pointers, nothing sophisticated. Do loops, if statements, subroutine calls.