Huh / collar

Utilities for exploring telemetry data
Other
7 stars 9 forks source link

Function name prefix #13

Open Huh opened 6 years ago

Huh commented 6 years ago

I will propose that we prefix every function name with cllr. This will make it easy to find functions in RStudio using the suggestions, so a function might be called cllr_foo or cllr_fetch_csv or whatever, but it will always start with cllr. Other suggestions?

rgzn commented 5 years ago

Not sure this is a good idea. The standard way to solve this issue is the use of namespaces instead of making all function names longer.

All functions in the collar library should be in the collar namespace so should be used as follows:

collar::foo collar::fetch_csv

Huh commented 5 years ago

The reason for doing it is speed/convenience. Those using editors with auto-complete can type cllr and see all the functions in the package. It is in the spirit of stringr. If you don't like it we can reconsider. I like having a crutch and while namespaces do help avoid name collision it doesn't solve the problem without explicit calls.

Huh commented 5 years ago

I don't have a strong opinion about this and another person brought up the same idea of dropping the object_verb naming convention. We should revisit the conversation

Huh commented 5 years ago

Have revisited several times now and looks like we are working towards families of functions.

All of the fetch_* functions retrieve data for example. I think this is a nice hybrid solution, other thoughts?

kissmygritts commented 4 years ago

@Huh just chiming in to agree with @rgzn. I tend to type collar::fetch_csv when I use packages and want text completion. This is kind of attempting to add namespacing when it already exists. I do like your design philosophy of families of function.

Huh commented 4 years ago

Thanks for the feedback @kissmygritts

I think I agree with you. I would like to reorganize the package a bit and this could be part of that effort.