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

docs(tutorial): Expand the default_value_t example #4906

Closed

Conversation

nicholasbishop
Copy link
Contributor

There are a lot of attributes for setting defaults, and it may not be immediately obvious how to set defaults for types like String and PathBuf. Update the example to show each of the attributes for setting defaults.

There are a lot of attributes for setting defaults, and it may not be
immediately obvious how to set defaults for types like `String` and
`PathBuf`. Update the example to show each of the attributes for setting
defaults.
@epage
Copy link
Member

epage commented May 18, 2023

The tutorial is not generally meant to be exhaustive like this. I'm inclined to close this.

@nicholasbishop
Copy link
Contributor Author

I'm not sure what the right solution is, but as a user of the API I'll note that default values are a particularly tricky part, especially relative to how common the desire to set default values is. The names are not obvious in that there's no way to intuit what the difference is between default_value and default_value_t.

Personally I think it's worth giving more space to it in the documentation. At the very least, I think it's worth framing the question as "how can we make this clearer" rather than "is the tutorial meant to include this".

@epage
Copy link
Member

epage commented May 18, 2023

Personally I think it's worth giving more space to it in the documentation. At the very least, I think it's worth framing the question as "how can we make this clearer" rather than "is the tutorial meant to include this".

Yes, the documentation can and should be improved. The question isn't about the intent of this PR but how to do it. Writing documentation is hard, probably the hardest area for drive by contributions. You need to balance clarity for the end-user, technical correctness, and narrative. Just dumping more stuff in there isn't the eight way to handle this.

@nicholasbishop
Copy link
Contributor Author

Fair enough, thanks for taking a look.

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

Successfully merging this pull request may close these issues.

2 participants