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

suggestion: re-structure std/log to adhere to singe-export files #4174

Closed
Tracked by #4102
iuioiua opened this issue Jan 12, 2024 · 6 comments
Closed
Tracked by #4102

suggestion: re-structure std/log to adhere to singe-export files #4174

iuioiua opened this issue Jan 12, 2024 · 6 comments
Assignees
Labels
feedback welcome We want community's feedback on this issue or PR

Comments

@iuioiua
Copy link
Contributor

iuioiua commented Jan 12, 2024

Each file should export only tightly-related symbols.

Background #2936

@iuioiua iuioiua self-assigned this Jan 12, 2024
@kt3k kt3k added the feedback welcome We want community's feedback on this issue or PR label Jan 12, 2024
@kt3k
Copy link
Member

kt3k commented Jan 12, 2024

We recently sometimes choose non single-export file pattern (e.g. std/text/cases). What is the criteria to follow the pattern or divert from the pattern? Can we create an objective rule about it?

@iuioiua
Copy link
Contributor Author

iuioiua commented Jan 12, 2024

I think it's reasonable to group multiple symbols in the same file if at least one of the following is true:

  1. Their signatures and dependencies have near-total overlap. E.g. std/text/cases
  2. The symbols are highly likely to be used in conjunction. E.g. encoding and decoding functions.

These criteria should justify cases with many symbols within a given file or just one.

I'd be happy to document this if this sounds reasonable.

@kt3k
Copy link
Member

kt3k commented Jan 12, 2024

Ok. Let's document them in README

@eryue0220
Copy link
Contributor

Can I have a tried for this one?

@iuioiua
Copy link
Contributor Author

iuioiua commented Jan 29, 2024

Sure! I believe the next step is to factor out setup() into its own file.

@iuioiua
Copy link
Contributor Author

iuioiua commented Feb 2, 2024

Completed in #4254.

@iuioiua iuioiua closed this as completed Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feedback welcome We want community's feedback on this issue or PR
Projects
None yet
Development

No branches or pull requests

3 participants