025. Avoid polluting the namespace by using use
-only
#
topic: Modules
In Fortran,
use m
is equivalent to Python
from m import *
It is better to write
use m, only: foo, bar
to avoid polluting the namespace and to clarify the origin of imported entities.
In Fortran,
— FortranTip (@fortrantip) December 19, 2021
use m
is equivalent to Python
from m import *
It is better to write
use m, only: foo, bar
to avoid polluting the namespace and to clarify the origin of imported entities.