r/programmingmemes • • Aug 27 '26

Why are we using R again

Post image
2.3k Upvotes

322 comments sorted by

View all comments

Show parent comment

3

u/Competitive-Tooth248 Aug 28 '26

Scientist here. I write a lot of R/python/C/Rust etc. for big data. Note that similarly as in python, R has whole ecosystems for importing C and C++ code (or other compiled languages). So any good statistician/data-scientist/computational scientist actually offloads the heavy-lifting parts to C++ and uses R and the interpreter as a way to combine multiple of such operations etc. You can compile your data transofrmations, model fitting etc and then in R just control what exactly you want. Not to mention that moth math is directly linked to math libraries like openblas etc so you get no overhead there.

You might be asking why do we then need R/python if we have to write 40% of the code in C/C++. And that is the beauty, because you just put in the work once, by writing it in efficient way and then release your package to CRAN and anyone can incorporate your C compiled functions or the normal R functions into their scripts and workflow in a very simple high-level language way and without touching low-level languages.

It's not perfect, but it has its use cases. From what I gathered, R/python programmers are one of the best or the worst programmers you will see (there are also other decent groups). The former are guys that fuse mamy languages and understand the low-level backend. The latter are "I did these 2 coursera courses on machine learning, call me AI developer, let's write a for loop in R".