Post AT7a8TMZ2IFsMl0I6K by hochata@emacs.ch
 (DIR) More posts by hochata@emacs.ch
 (DIR) Post #AT5CdEo2QCmayo4VOq by konstantin@m.iamkonstantin.eu
       2023-02-26T19:52:02.566076Z
       
       0 likes, 0 repeats
       
       I think the most challenging aspect of my intro into Elixir over the past couple of months has been the alias, import, use and require directives. I always forget which one does what and I’m yet to discover the underlying logic for having a different keyword. #elixir #DevLife #learningElixir
       
 (DIR) Post #AT5CdFOCFlhqmwzNlA by hochata@emacs.ch
       2023-02-26T20:48:46Z
       
       0 likes, 0 repeats
       
       @konstantin In my opinion, you should mostly think about alias and use.alias allows to write shorter code by allowing to use a short name instead of the full module name.use is a blank canvas that each library developer decides how to implement, so it is probably what you should use when dealing with third party macros (like Ecto).When in doubt, just use alias, or check the library documentation.
       
 (DIR) Post #AT7a8Ss4rdruqCjwa8 by konstantin@m.iamkonstantin.eu
       2023-02-27T06:42:46.983175Z
       
       0 likes, 0 repeats
       
       @hochata Checking the docs is indeed a good call. I’ve been trying to develop mental model for how to deal with it but it seems that it can really depend on how the dependency is implanted (that’s not necessarily visible just by it’s signature).
       
 (DIR) Post #AT7a8TMZ2IFsMl0I6K by hochata@emacs.ch
       2023-02-28T00:21:33Z
       
       0 likes, 0 repeats
       
       @konstantin That is true. The correct way to use dependencies usually depends on how they were implemented.But, in my experience, in most cases an alias is enough.Import and require modify the local scope in ways that is almost never necessary.