-
Notifications
You must be signed in to change notification settings - Fork 3
chore(*): rename name and res
#324
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
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, but I really hate this. I'm not opposed to renaming them necessarily but I think the work of explaining their usage is up to the docs no matter what and I'd rather they be shorter rather than bloating the code with long identifiers.
fair enough. I understand that you chose those names deliberately, but I still think that the naming is not very intuitive (even though it might be more practical if used often) and requires the user to study docs first in order to understand how the builder works. I my opinion we should reduce the entry effort for people as much as possible, and I am just wondering if that is "consice but a bit too generic names" like If you - for a second - forget, that you wrote this, would you immediatedly get that Another problem with Why do I think
|
| /// .gas(coin) | ||
| /// .gas_budget(1000000000); | ||
| /// ``` | ||
| pub fn result_refs(&mut self, name: impl NamedResults) -> &mut Self { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think name_res() would also make it clearer than just name() and then res() should still be fine to reference a result
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, but I don't think there's any need to have shortened names here.
- If a user of the api finds the method name too verbose s/he can always rename to
resor whatever in the import. - The user will hardly require all API that the builder provides (i.e. all 33 examples), but only a few of them tailored to their need. Hence, long names aren't really an issue, hence if I follow your naming suggestion, I would just call it
name_result()on the buider, anduse_result()(or whatever) as the imported method.
This PR renames some public API because I hope this will make it a bit easier for the user to tag/name/label results from a command, and later reference them again in follow-up commands. By no means I think this PR has to be merged. It's here to discuss whether we want to keep the old naming or whether we pick something else. IMHO the current naming is a bit confusing and favors conciseness, the new names are a bit less concise but I hope easier to understand for the user. I also added more docs to the methods in question to foster this even more.