5 ms·
Whoa, you know this is hacker news right? You don't get to call R elegant around these parts.
by clircle 4y ago
Whoa, you know this is hacker news right? You don't get to call R elegant around these parts.
- bryanrasmussen 4y agoI think R is elegant, what's inelegant in it (other than the code lots of non-programmers write with it)?
- fny 4y agoIt has 4 ways to do object orientation if IIRC, none of which are compatible.
- bbertelsen 4y agoS3, S4, R6, and reference classes. To be fair they are situational and not one size fits all. The stricter ones are mainly used in biostats where significant metadata makes more sense in OO. S3 is nice and easy, primarily just a list with dispatches. Everything else is less so.
- kgwgk 4y agoDon't forget R7. https://rconsortium.github.io/OOP-WG/ https://rconsortium.github.io/OOP-WG/
- nerdponx 4y agoCore language design? Definitely elegant in my opinion. F-expressions, clever "formula" syntax, everything is an array, great C/C++/Fortran interop. Standard library? Absolute chaos. Some elegant subsets, but mostly a mess that you learn to live with.
- isoprophlex 4y agoThe type system is so abhorrent, it makes me wonder if it's actually proper to call R a real programming language
- kgwgk 4y ago"There are only two kinds of languages: the ones people complain about and the ones nobody uses."
- dunefox 4y agoThis crappy quote is always used to justify bad design.
- isoprophlex 4y agoI'm sorry, did you mean [1] "There are only two kinds of languages: the ones people complain about and the ones nobody uses." :^)
- mike_ivanov 4y agowhat specifically is abhorrent about it?
- isoprophlex 4y agoThe coercion always gets on my nerves, JavaScript gets a bad rep but R is pretty damn warty too; weird ass data types ('ordered factor', anyone) that just seem so very far away from design choices in other languages without being particularly ergonomic or aesthetically appealing
- kyllo 4y agoThe data types make sense to statisticians. Ordered factors are great when you need to fit, say, an ordered logit regression model.
- mike_ivanov 4y agoWhich coercion specifically are you talking about? Could you give an example? Weird data types: R had been designed for and by statisticians with their specific needs in mind, which indeed could look weird to regular people.
- 4y ago
- chubot 4y agoR isn't elegant, but tidyverse is If you learn tidyverse, then you're going to cringe whenever you use Pandas or most things in the Python data science ecosystem https://www.rstudio.com/wp-content/uploads/2015/02/data-wrangling-cheatsheet.pdf https://www.rstudio.com/wp-content/uploads/2015/02/data-wran...
- deleted 4y ago[deleted]
- clircle 4y agoOh, I do cringe at Pandas.
- adonig 4y agoI remember when we first used R in a stochastic class. The professor (a mathematician) was in love with the language and the students (computer science) considered the language to be the PHP of science.
- peoplefromibiza 4y agoas a computer scientist and programming languages nerd, I think R is a much better language than Python (comparing the two only because Python is leading in the data science field) I also believe that the tools available are superior, RStudio is very good IMO. I wonder why R has such a bad reputation.
- kyllo 4y agoA lot of programmers dislike R for the same reason they dislike PHP: weak typing. If you can get over that, though, there's a lot to like about R. It's sort of like a hybrid between a Lisp and an array language.
- chaxor 4y agoIirc the scoping is also very strange. Certainly not as bad as mathematica, but bad nonetheless.
- mike_ivanov 4y agoWeak typing? No, it's not. R is a strongly typed language. > 1 + "string" Error in 1 + "str" : non-numeric argument to binary operator
- goatlover 4y agoJavascript and C also have weak typing. And Python isn't statically typed, it's just that like Ruby, it doesn't allow implicit conversion, except with numbers.
- bart_spoon 4y agoBecause it’s built around a very specialized set of needs (data manipulation, visualization, and statistical modeling), and it is essentially best in class at it, but it has quirks as a result. Anyone coming to R from a background in another language will feel those quirks intensely and assume it’s bad.