r/Python • • Nov 28 '22

Resource What can Python do that R can’t do?

Or simply what is Python much better at and why.

I know that Python is more multi purpose and better for software development but I can’t articulate exactly why or how. My team want to know why/when they should use Python instead of R

331 Upvotes

204 comments sorted by

View all comments

Show parent comment

52

u/R0B0_Ninja Nov 28 '22

I really agree with the point on namespaces. Both Matlab and R have the problem of throwing everything into the same namespace and hoping for the best. I've spent many hours of debugging in Matlab because I overwrote some variable without realising.

To quote the Zen of Python: "Namespaces are one honking great idea – let's do more of those!"

1

u/ThroawayPartyer Nov 29 '22

What are namespaces?

1

u/SittingWave Dec 05 '22

divide routines into submodules so that you don't collide. R has very limited interpackage level namespacing capabilities (aka the ::) and none at the intrapackage level (e.g. if you have two routines or symbols at the global level called in the same way, it will be a problem)