Last week’s 2013 useR! conference was filled to the brim with informative talks, but hands down the crown for most entertaining talk goes to Rasmus Bååth’s State of Naming Conventions in R presentation.
Rasmus’ lighthearted talk leveraged the strongest common bond among R users: collective suffering at the hands of R’s haphazard naming conventions. Who among us hasn’t fumbled away at the keyboard trying to recall the punctuation scheme of some scarcely used utility function?
Whereas other programming languages demand adherence to rigid naming conventions, R’s function names are a veritable circus.
And that’s just in base R!
After several laughs over the dire state of affairs, Rasmus transitioned to exploring the negative consequences of heterogeneous naming conventions. Namely, they make R harder to learn and harder to use. For example, when trying to use the as.Date() function, a user might make several attempts before ultimately finding the correct function call.
Clearly things could be better with the benefit of hindsight, and it was at this point in the talk that I began to wonder whether Rasmus could “bring things home”, so to speak. Yes, the conventions are chaotic, but just as we can’t tear up a city’s streets and relay them in a more intelligent configuration, we can’t simply rename all of R’s existing functions.
Naturally, Rasmus had a very practical suggestion:
Autocompletion is a great tool, but in many IDEs autocompletion does not work if you’ve already made a mistake. For example, if users try to find the function ‘Vectorize’, autocompletion in some editors will leave them high and dry.
The onus, Rasmus argues, is on developers to bridge the gap between users and R’s inconsistent naming schemes.
Fortunately, that gap has already been bridged. Architect users have long enjoyed intelligent autocomplete functionality. Simply use ‘Ctrl + Space’ and the Architect editor will suggest matching functions, regardless of your exact syntax.
Can’t remember the exact way to specify a function? No problem.