-
Notifications
You must be signed in to change notification settings - Fork 26
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
Drop compute_
from function names?
#328
Comments
Think it's a matter of opinion. Using verbs for method names and nouns for object names is not part of PEP 8, but some consider it best practice. In R it's very standard that function names are verbs; for the tidyverse it's by convention. Personally I like it, especially if it doesn't return a new object of the same name (e.g. |
Good points, thanks for chiming in on this! |
Just saw this landing page for an R package (tidyplots); try having a look at the figure by the link to the bioRxiv preprint - that's something I'd want for animovement at least - using verbs deliberately and consistently. Where it's almost possible to reason your way to the function you need next. :) |
I like the concept of "action verbs", quite inspiring. |
After a few discussions, and also taking into account @roaldarbol's input, I will close this as "not planned". |
All our functions for computing metrics derived from the data take the form
compute_metric
, for example:compute_velocity()
compute_path_length()
compute_interindividual_distances()
compute_norm()
Pros:
Cons:
foo()
(with brackets) will trigger some computation (as apposed toobject.property
)I can't think of many packages that something similar to this, happy to change my mind.
The text was updated successfully, but these errors were encountered: