jkrumbiegel / DataFrameMacros.jl

Macros that simplify working with DataFrames.jl
MIT License
60 stars 5 forks source link

Naming of flag macros #8

Closed knuesel closed 2 years ago

knuesel commented 3 years ago

How would you feel about longer names for the macro flags?

Code using DataFramesMacros is typically super readable: I think even people unfamiliar with the package can easily guess what the code is supposed to do... except for these cryptic one-letter flags! I would personally prefer @bycol, @byrow, @passmissing and @astable (or @AsTable).

It's of course more verbose but isn't it worth it for readability?

Also it would mean passing multiple flags as separate macros, e.g. @bycol @passmissing instead of @cm. But I find the readability improvement even higher in this case.

Note I'm not suggesting to have both long and short names because I find such fragmentation even worse for readability.

(I thought it would be interesting to discuss this before it's set in stone, but feel free to close this issue!)

jkrumbiegel commented 3 years ago

Thanks for the suggestion, although I deliberately chose these short versions because there are only four letters (currently) and they can only appear in one place, so if one learns to use the package, there is not that much overhead. My personal preference tends towards as-short-as-is-reasonable. It's true that they are not self-explanatory, but that's also a relatively high bar for code.

knuesel commented 3 years ago

OK no problem, thanks for answering!

jkrumbiegel commented 2 years ago

After using the system for a while I started to dislike the short macros. Just not readable enough, so I'm reverting in https://github.com/jkrumbiegel/DataFrameMacros.jl/pull/24 to the explicit versions as you suggested last year.