Hacker News new | ask | show | jobs
by mespe 1997 days ago
This.

My first thought was "I hope I never encounter code that uses this." It's interesting as a proof of concept, but it makes your R code difficult to understand to 99.9% of R programmers. In my opinion, that is a pretty high cost for what I would consider mostly syntactic sugar.

1 comments

I agree with this.

That said, a lot of the use-case of R is one-off scripts, run locally on a machine by an analyst, as part of preparing a written report for non-technical stakeholders. So the code readability isn't as important.

This is both a strength and weakness of R in general. The R community has many different ways to accomplish the same goals. Production systems decline to use R in large part because of the code maintenance burden across a team, versus Python's "one right way" approach.

Every time I think code readability isn't important, I am inevitably proven wrong. Either I need to go back months later and need to figure out what I did, or I end up sharing with others. Even those one-off, "never going to touch this again" scripts.
I wonder how true this "one right way" is? For instance, I've seen multiple ways to do the same thing in Pandas.

Does it come down more to an agreement among the team about how code should be written?

I found that the "one right way" python's mantra fall apart when it comes to pandas and numpy. Those libraries must be seen as DSL on top of the language IMHO.