Skip to content

Comment on Is it true that "R is the easiest language to speak badly"?

Comments

R as a language is highly multi-paradigmatic, while remaining essentially a specialized tool for statistical analysis whose users, often scientists, are not first and foremost programmers. Also, the usefulness of R depends on a huge range of contributed packages, leading to duplication of effort and disparate approaches to the same problems.

Because the language is friendly and intuitive enough on the level of manipulating datasets, and template code is available for all of the popular tests and plot types, you can go very far in R without actually learning to program deeply. Considering all this, it is not surprising that a lot of user code is inelegant, inefficient, etc. Perhaps we should be more tolerant of this, compared to other languages, in light of R's status as a rough 'n ready tool for quick analysis, simulation and prototyping.

Of course, reference and contributed R code should show exemplary style. And R code that is aware of the intricacies of the language - the consequences of lexical scoping with lazy argument evaluation, S3, S4 + Reference classes, environment implementation, the possibilities of 'computing on the language' - can be a thing of beauty. I think it's a wonderful language, and I would like to see many of its features implemented in more general purpose languages for application development.

Often it's just the little things. As a very basic example, I am someone who has always disliked that the assignment operator in so many languages is the mathematical symbol for equality. I'm not entirely happy with prefix syntax for assignments either. While R supports "=" and assign() for assignment, it pleases me no end to use "<-" or "->" (and the corresponding nonlocal "<<-", "->>"), with their implicit directionality and action of a target "getting" a value.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.