3 ms·
According to Zed (who from my understanding has programmed in R a fair amount), these are some of the worst style guidelines ever: http://twitter.com/zedshaw/st
by tsally 17y ago
According to Zed (who from my understanding has programmed in R a fair amount), these are some of the worst style guidelines ever: http://twitter.com/zedshaw/status/3690822968 http://twitter.com/zedshaw/status/3690822968.
- hyperbovine 17y agoZed Shaw trades on being loud & opinionated, so he pretty much has to say something :) On some points he's correct, but a lot of these are definitely found in R books, and R code in general. Periods certainly predominate in variable names everywhere, the reason being (as I understand it) that the underscore is synonymous with the assignment operator <- in S-Plus--pretty hideous. Verbing and camelcasing your function names is a bit outta left field, most functions tend to look like variables (indeed, technically they are.) Maybe it's not such a bad thing to distinguish them. kConstantName I definitely don't like, reminds me too much of Hungarian notation and CONSTANT just makes more sense and is more common. Almost no one uses = in place of <-, which is a shame because there is no <- key on the my keyboard :)
- gchpaco 17y agoI know in a lot of Smalltalks _ was the assignment operator, because in an old prerelease version of ASCII the symbol in that position was ←. I suppose it's possible S had this confusion too, although it's pretty obscure.