Closed luisaforozco closed 3 months ago
I've been exploring the different uses of using
and import
.
using
: brings all exported names from into the current namespace.import
: does not bring any names into the current namespace. You need to prefix all function calls with ModuleName
.I agree, I prefer import
for clarity. This will clash with multiple dispatch as we discussed last week, but I would say we can solve that by only changing those cases where it's an issue to using
.
The SciML style guide seems to have this preference as well, although it's not super clear. They also prefer using LinearAlgebra: dot
over using LinearAlgebra
, that's apparently also an option to make clear what you're using from where.
Context: current situation
In the examples we are importing the dependencies via
using
andinclude
. Also, the julia files inexamples/coupling_functions
rely on importing the dependencies from the notebooks.Desired situation
We should make the dependencies link clearer by using:
And in the examples, importing near to the first usage so that it becomes clearer why did we import a dependency.