MRC-CSO-SPHSU / LoneParentsModel.jl

An initial implementation of an ABM for social and child care
0 stars 5 forks source link

Import vs. Using #41

Closed AtiyahElsheikh closed 2 years ago

AtiyahElsheikh commented 2 years ago

The book "Hands-on design patterns and best practices with Julia" recommends to employimport when a functionality is being extended, otherwise to employ using by default. This is so far the way I have followed.

mhinsch commented 2 years ago

Keep in mind that import and using have subtly different semantics. I think if we follow the rule that all imports have to be explicit (i.e. no using ) then we might just go the full way and prohibit import altogether (and use explicit name resolution for method definitions).

AtiyahElsheikh commented 2 years ago

I employ using also in an explicit way, e.g. using Random: shuffle!

mhinsch commented 2 years ago

Sorry, my comment was partially eaten by the md formatter. Where it says 'i.e. no using' it should have said 'i.e. no using modulename' (I included modulename in < and > which apparently made it disappear).