I am working through Tom Kwong’s book "Hands-On Design Patterns and Best Practices with Julia." In Chapter 7 on Maintainability Patterns, Tom talks about organizing code (sub-module pattern) and gives an example where a module simply includes functions from a file, in which the code is not organized within a sub-module. E.g.,
# funcs.jl
export func1, func2
function func1()
# body of func1
end
function func2()
# body of func2
end
That code is then included in the main package, like the following minimal example.
# MyPackage.jl
module MyPackage
include("funcs.jl") # code for func1 and func2
end # module
It may not be a big issue, but I would not have “hidden” export statements within some file. Instead I would have chosen to make the exports remain explicit within the module that exports them? E.g.,
# MyPackage.jl
module MyPackage
export func1, func2 # contained in funcs.jl file
include("funcs.jl")
end # module
What is best practice in this regard?