Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Some good points. Certain things are easier in R and often you can find code snippets that perform certain statistical tasks "the right way" and they are more concise than they would be in Python.

To me, R always felt a bit quirky.

I don't think R is much better at functional programming than Python. I found R to be limiting in terms of general programming.

Also, we now have type checking. I'm positive you could combine type checking and clever type declarations to handle application state like in elm.



> I don't think R is much better at functional programming than Python.

R is a functional programming language. Does Python treat functions as first-class citizens? Pass arguments by value? Store expression trees as data structures?


First class functions and pass-by-value have been in basically every language that was designed in the last 30 years, and have been added to most of the popular ones that existed before that. Homoiconicity is less common, but is still present in some form in most recent languages that were originally designed to be interpreted or JIT-compiled (Python is no exception here).


Python can do all that. It doesn't force you to do it, and handling expression trees may be a bit complicated (using ast).

For me the main defining feature of functional programming is the ability to pass functions and the ability to avoid side effects.

If I remember correctly, I often had trouble with side effects in R.


Could you elaborate on that? R is not a pure functional language (like, e.g., Haskell), so it's possible to produce side effects, or even "leak state", but it's hard to do it accidentally.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: