Hacker News new | ask | show | jobs
by qqqwwweeerrr 1649 days ago
I hear the complaint that R is a terrible language mainly from professional programmers.

I'm sure it is poorly designed from a computer science perspective, but there is no programming language out there which makes it so easy to run any model under the sun as does R.

1 comments

I think that’s not a feature of the language, but of its libraries. R is popular for similar reasons why it’s so hard to replace python.

In Python’s case, the language isn’t bad, but the implementation is horrible for performance. It sits on the back of lots of fast C/Fortran/whatever code, and polished the (relative) turd a lot, making the end result quite usable, but the “sitting on top of part” also makes it hard to improve the performance of the implementation.

For both R and python the end result is good, but they still are local optima in the space of what is possible.

I've had the opposite experience. My preferred programming style is functional. My current gig has been in Clojure, and I couldn't ask for a better product programming language. I find Python code very difficult to write in a functional way (even the official howto is littered with for loops [1]), but in R I can feel an underlying lispiness, and the pipe operator `%>%` from magittr is really nice: whereas in Clojure there is `->`, `->>` and `as->` for thread-first, thread-last, and named threading respectively, in R with `%>%` I get thread-first as the default and I can override it by placing `.` wherever I want in the downstream function calls.

[1] https://docs.python.org/3/howto/functional.html