4 ms·
Wow, people here are being pretty hard on this article. I'm sure everyone here on HN has read their share of programming language flamewars, and this one doesn
by geebee 10y ago
Wow, people here are being pretty hard on this article. I'm sure everyone here on HN has read their share of programming language flamewars, and this one doesn't come close. It's pretty mild.
I also think it gets something right - it does feel different to use Python and R, and the reason may be rooted in how these languages arrived at data science. Python, as the article points out repeatedly, is a general programming language that scientists liked using for numerical computing, so slowly it acquired a billion libraries for data analysis, stats, machine learning, and so forth. R was created by scientists and statisticians specifically to do stats and analysis, but in order to be useful, it needed to acquire the full capabilities of a programming language.
What feels most natural to you often depends on what direction you come from. If you're a programmer taking on data science, you may gravitate toward python. If you're a statistician getting deeper into code R may feel more natural. It would behoove you to learn both.
What on earth is wrong with that? I suppose that for a few people on HN, this might be a bit repetitive. But otherwise, I'd recommend this article as a relatively non-combative bit on explaining the different languages, especially for someone getting started.
- cwyers 10y agoBecause the author is wrong a lot.
- geokon 10y agoIt's been a few years since I've done some real R work, but my general impression of things was that "core R" - ie. the R that is explained in the R manual - is actually a bit deprecated. It's not the correct way to use R. The correct way is to use the Hadley tools (ggplot, dplyr, etc.) These tools are grafted onto R - but seem to have a completely different design philosophy. I actually don't know why they're in R and not Python or C++ or whatever other language - but they form a set that is very easy to work with and produce results really quickly (especially in combination with RStudio). So the design principles behind R (or I guess the S language) kinda becomes irrelevant.
- hooloovoo_zoo 10y agoPython is similar. Base Python is terrible for data analysis but a large number of useful packages have grown up around numpy (scipy, pandas, theano, keras, etc.) which has similar conventions to R.
- apathy 10y agoR is explicitly designed around S-expressions and as such lends itself to domain-specific languages like these. The choice was not an accident either by the original Rs (Robert Gentleman and Ross Ihaka) nor by Hadley. Guido has explicitly stated that he does not want Python to be "more lispy" e.g. in regards to lambdas (asterisk). Thus I've seen many people even at, say, Stanford, Harvard, and Cambridge going back to R from Python. Sometimes there does not exist a language that best suits a workflow, and a DSL works better. That is where lispy languages hold an advantage. Use the right tool for the the job, imho, but I fucking hate people that mix the two within a project intended for wide public release. Worst of both worlds, again imho. (Asterisk) apparently functional data structures such as iterators and generators are OK though. Wtf guido
- lottin 10y agoThe "standard" R libraries cover most of the stuff. There are a couple of things that are hard to do. Hadley's libraries are very popular, but saying that R base is "deprecated" or somehow "not correct" is completely wrong. Also all these libraries are somewhat tied to R data structures and often take advantage of R's peculiar evaluation rules of function arguments, which means they're not that easy to port to other languages.