2 ms·
> Say what?! Maybe it's because R is heavily used by non-programmers, there is this weird belief that R should be easy to grok by anyone with programming exper
by PheonixPharts 4y ago
> Say what?!
Maybe it's because R is heavily used by non-programmers, there is this weird belief that R should be easy to grok by anyone with programming experience, and if they don't immediately get it, it must be R's fault. Of the programming languages I've used, R is much closer in terms of changing your view of programming to Haskell and Lisp (a good chunk of R essentially is a Lisp) than most other 'blub' languages [0]
R certainly has quirks, but most of them come from being one of the oldest programming languages out there (considering it is ultimately an open implementation of S which came out in 1976) and so has a lot of programming patterns that may not be familiar for modern programmers.
Not understanding that R is fundamentally a vector based language and what a vector based language is is akin to approaching Haskell and not having any understanding of Functional Programming, finding no for-loops and saying it's a silly language.
If you are someone who is very curious about programming languages and different programming paradigms, and likes doing numeric/statistical computing, I highly recommend approaching R with a very open mind, and being willing to explore it more carefully. As just one example: one of it's multiple object systems is using Generic functions in the same way that Common Lisp's CLOS does. The best example is R's `plot` function which is a generic function dispatching based on the class of the argument. Again this is something that less experienced programmers see as confusing and stupid, whereas someone with a better understanding of the development of OOP will likely find this very interesting.
0. http://www.paulgraham.com/avg.html http://www.paulgraham.com/avg.html
- JHonaker 4y agoI was going to mention the (at least) three different kinds of OO-y systems in R, but you already did. I think the reason that it's so hard for people to grok is that it's so old that a lot of code already exists, and a lot of that code is still used today! Many libraries use different implementations of the same ideas for different things. It can be hard to handle if you're someone who likes to understand the whole system. R is a fascinating language in its own right though. I'm not aware of many languages that give you first class control over environments as well or as easily as R. It can definitely enable some "lisp curse"-type code though. R more than any language (even Scheme) lives the "build a DSL for your problem" dream that so many of us like from more standard languages. Consider the various ways to specify formulae for models; the very different ways to specify graphics in the base, GGPlot, and lattice libraries; and the various ways to to describe data transformations via the base functionality, the Tidyverse, the Tidyverse + Purrr, and data.table.
- andersentobias 4y agoWould you be interested in tutoring a experienced programmer (me) in using R?
- JHonaker 4y agoWhat do you want to know?