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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make clear the " alias, require, and import " also talks about use #13559

Merged
merged 2 commits into from
May 20, 2024

Conversation

PragTob
Copy link
Contributor

@PragTob PragTob commented May 14, 2024

Browsing the docs I found the page and found it weird that it didn't mention use (as the 4 of them go together), reading the page I realized that it does mention use but it's just not mentioned in the headline so this seemed like an easy fix.

I did not modify the file name, although I think it'd be better to also rename the file (and references to it). However, I was worried about breaking outside links to https://hexdocs.pm/elixir/alias-require-and-import.html I'm looking for guidance on:

  • is the breakage ok
  • should we just not break
  • should we break and maybe leave a note in the existing file that documenation moved (and hide from the getting started)

Thanks for all your work as usual! 馃挌

IMG20230429163945

Browsing the docs I found the page and found it weird that it
didn't mention use (as the 4 of them go together), reading the
page I realized that it _does_ mention `use` but it's just not
mentioned in the headline so this seemed like an easy fix.

I did _not_ modify the file name, although I think it'd be better
to also rename the file (and references to it). However, I was
worried about breaking outside links to https://hexdocs.pm/elixir/alias-require-and-import.html
I'm looking for guidance on:
* is the breakage ok
* should we just not break
* should we break and maybe leave a note in the existing file
  that documenation moved (and hide from the getting started)
@josevalim
Copy link
Member

Hi @PragTob! I am not actually sure about this change. In a way, I understand that for most Elixir developers they are at the same level, but the first three are really language features while use is a convention. So I think the current title highlights well their relationship. I am open to hearing more thoughts. :) (but yeah, we should not change the filename!)

@PragTob
Copy link
Contributor Author

PragTob commented May 14, 2024

馃憢

As usual I suspected that there was some reasoning I wasn't privy to and not just an oversight 馃槄

My reasoning was just that what I was looking for was a comparison of the 4 (to double check my understanding before writing on it, and to link to more extensive docs) and I almost didn't read the page/was going to look for more as it didn't mention use. I scrolled down to see if the "next" chapter maybe covered use and was pleasantly surprised that the chapter did cover use.

In the body it's also covered on the same level as alias, require and import and no real distinction is made there. That's why it seemed like an oversight to me and well mostly I didn't expect it's docs there due to the title.

I'm also interested in the PoV of it being a convention - since to my eyes (not a language designer/core contributor) use is very much part of the language. I guess what you mean is you could also just call another macro in the body and so it's not necessary per se which I'd get :)

Anyhow, that's why I thought it'd be worthwhile. As always, up to you! 馃檱 馃挌

@v0idpwn
Copy link
Contributor

v0idpwn commented May 14, 2024

Maybe it's a good idea to split use into its own page. It feels a bit out of place there.

@PragTob
Copy link
Contributor Author

PragTob commented May 15, 2024

I'd definitely expect it there as it's the 4 ways we... I dunno... reference other modules usually at the top of our module. Imo esp. beginners wonder about when to use which one (I know I did, and lots of people I taught did to) so having them all in one page highlighting their differences totally makes sense to me :)

@josevalim josevalim merged commit fb3db59 into elixir-lang:main May 20, 2024
1 check passed
@josevalim
Copy link
Member

馃挌 馃挋 馃挏 馃挍 鉂わ笍

@PragTob PragTob deleted the alias-require-import-and-use branch May 20, 2024 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants