I get to propose a variable naming convention.
Give me your "I'll die on this hill" opinions about variable names #databs #rstats
Give me your "I'll die on this hill" opinions about variable names #databs #rstats
Comments
Abbreviations should include what convention they follow like "fips_state".
Foreign key ids should be labeled as [foreign_table_name]_id.
All of this ensures the context is immediately understood.
😎
(3/10)
Similar to how adjectives must be in the same order in natural language.
ANALBUMRELEASED
My hills I’ll die on: https://www.emilyriederer.com/post/column-name-contracts/
{tier 1}_{tier 2}_{etc}
I’m somewhat agnostic to the ordering of those, but post has some examples how it makes things like autocomplete or bulk aggregation easy
I'm thinking {survey wave}_{topic}_{abbreviated question wording}_{optional identifier for free text/other/question sets}
But not sure what they'll do in wave 27...
Much easier to code with, much more explicit, and I don't have to keep going "hmmm what number is j again?"
I saw somebody say their always name their functions in a verb like fashion to describe what they do.
I'd love to hear people's ideas!
https://style.tidyverse.org/syntax.html
For instance, a variable named 'age' will have a different meaning for a dataframe named 'dta_antiques' vs. 'dta_students'.
Obvious as hell, but I didn't see guides make this point.
My priority right now is making the names human readable (within reason) and to avoid excessive reference to the dictionary
I haven't mastered managing them, but I need to as they're pretty handy.
https://thenewstack.io/best-practices-for-naming-variables-what-the-research-shows/
I dislike very cryptic naming, or where you need to refer to a separate document to decipher what is going on, but that can result in long column names!