News for hackers. Stuff that matters.
Re:Ask HN: How would a programming language look if designed... by clircle on Friday December 17, 2021 @07:09AM (#29591112)
Despite constantly reading on this website that R is bad or wrong, I somehow manage to get all of my data work done quicker and with fewer headaches than excel, sas, or Python.
Re:Ask HN: How would a programming language look if designed... by rich_sasha on Friday December 17, 2021 @09:01AM (#29592216)
From memory, R is quite slow, and has syntax I found really ugly. Dots as part of names (my.variable), $ for member access, operators wrapped in % for pointwise operations, eg %*% for pointwise multiplication.

These probably shouldn’t matter but did for me. FWIW the statistical offering was fantastic.

Re:Ask HN: How would a programming language look if designed... by qqqwwweeerrr on Friday December 17, 2021 @07:40AM (#29591358)
I hear the complaint that R is a terrible language mainly from professional programmers.

I'm sure it is poorly designed from a computer science perspective, but there is no programming language out there which makes it so easy to run any model under the sun as does R.

Re:Ask HN: How would a programming language look if designed... by Someone on Friday December 17, 2021 @09:25AM (#29592554)
I think that’s not a feature of the language, but of its libraries. R is popular for similar reasons why it’s so hard to replace python.

In Python’s case, the language isn’t bad, but the implementation is horrible for performance. It sits on the back of lots of fast C/Fortran/whatever code, and polished the (relative) turd a lot, making the end result quite usable, but the “sitting on top of part” also makes it hard to improve the performance of the implementation.

For both R and python the end result is good, but they still are local optima in the space of what is possible.

Re:Ask HN: How would a programming language look if designed... by wcerfgba on Friday December 17, 2021 @09:43AM (#29592788)
I've had the opposite experience. My preferred programming style is functional. My current gig has been in Clojure, and I couldn't ask for a better product programming language. I find Python code very difficult to write in a functional way (even the official howto is littered with for loops [1]), but in R I can feel an underlying lispiness, and the pipe operator `%>%` from magittr is really nice: whereas in Clojure there is `->`, `->>` and `as->` for thread-first, thread-last, and named threading respectively, in R with `%>%` I get thread-first as the default and I can override it by placing `.` wherever I want in the downstream function calls.

[1] https://docs.python.org/3/howto/functional.html