Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import vs. Using #41

Closed
AtiyahElsheikh opened this issue Jul 14, 2022 · 3 comments
Closed

Import vs. Using #41

AtiyahElsheikh opened this issue Jul 14, 2022 · 3 comments
Labels
enhancement New feature or request
Milestone

Comments

@AtiyahElsheikh
Copy link
Collaborator

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

@AtiyahElsheikh AtiyahElsheikh added the enhancement New feature or request label Jul 14, 2022
@AtiyahElsheikh AtiyahElsheikh added this to the V0.3.X milestone Jul 14, 2022
@mhinsch
Copy link
Member

mhinsch commented Jul 14, 2022

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
Copy link
Collaborator Author

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

@mhinsch
Copy link
Member

mhinsch commented Jul 14, 2022

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants