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

About the methods naming like "compute_xxx" and "label_xxx" #167

Closed
minhuanli opened this issue Jul 10, 2022 · 2 comments
Closed

About the methods naming like "compute_xxx" and "label_xxx" #167

minhuanli opened this issue Jul 10, 2022 · 2 comments
Labels
question Further information is requested

Comments

@minhuanli
Copy link
Contributor

This is not a real issue but more like some thoughts from my own user experience, so apparently not urgent at all.

I am wondering if it is more helpful to change some methods name from "compute_xxx" to "xxx_compute", or add an alias like that.
For example, the "compute_multiplicity" to "multiplicity_compute".

This would be helpful for new users who tend to use auto-completion searching for related methods (Or maybe I am the only one doing this). A keyword plus a tab could direct them to the correct methods if exist, and no need to open the documentation.

Also this could be a good way to let them get access to all related methods of a core concept. For example, currently there are two methods dealing with absences: "remove_absences" and "label_absences". The new naming style like "absences_label" and "absences_remove" could make users immediately know there are two related methods when they type "absences" and try to auto-complete.

@JBGreisman
Copy link
Member

JBGreisman commented Jul 11, 2022

Personally, I like methods to be expressed with active verbs when possible: "compute_multiplicity", etc. While I am all for the sentiment of a more robust tab-complete, I don't think we should sacrifice the interpretability of methods to support that. I think that methods like "multiplicity_compute" would be difficult/non-intuitive to parse.

I also hesitate to over-populate the namespace -- I think that often makes it challenging to fully tab-complete through available methods.

@JBGreisman JBGreisman added the question Further information is requested label Jul 11, 2022
@minhuanli
Copy link
Contributor Author

You have convinced me!

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

No branches or pull requests

2 participants