Three free books for better programming in R (and any other language)

Like many users and producers of R packages, I have never had any formal training in computer science. I’ve come to to the conclusion that this is a serious omission in a professional researcher’s training. Computer scientists and professional hackers have learned a lot about effective, efficient programming over the last five decades and it’s past time academic researchers begin to learn from this experience.

To that end, here are three books which I think all users of R could benefit from reading:

Yes, I realize all of these are books that use Lisp/Scheme, and I realize the structure of Lisp can be a bit off-putting ((at '(first))). But, unless you want to learn Lisp, you shouldn’t try to read these books with the goal of understanding ever nuance of the syntax; rather, you should read them with an eye toward understand how a programming language should work for and not against you. For instance, each of these books shows, in a step-by-step approach, how seemingly complex programs can be effectively broken down into simple procedures that anyone with some programming experience can understand. A great deal of emphasis in these books is the important concepts of abstraction and non-duplication. If you’re like me and spend any significant amount of time going through various R packages, you’ll know what I mean when I say that the R community could benefit from less duplication and more abstraction in contributed packages (not to mention more comments!).

This entry was posted in Hacking, R. Bookmark the permalink.

4 Responses to Three free books for better programming in R (and any other language)

  1. dj says:

    This is major overkill. The weeks spent to grok those books would be better spent reading some respected texts on R and reading some quality code in R.

    • Jason says:

      I don’t think it is overkill or a waste of time at all, for a couple reasons. First, the texts are not that rough — you can get through Practical Common Lisp in a (short) week without too much problem. SICP and On Lisp are a bit longer and more intense, but you don’t need to read the whole books to get some benefit. And I think the insight they provide is quite valuable and will really save someone time in the long run.

      Second, I’ve read through some of the respected R texts and few of them that I have seen deal much with the fundamentals of programming. Sure, they teach you some syntax and show you how to get your work done (maybe), but they often become quickly outdated due to package changes, etc. And they almost never show you how to organize your code so that its accessible, replicable, and extensible.

      Third, the books provide insight on what lies beneath R’s “imperative” facade. R is at its heart a functional language with many similarities to Lisp and Scheme. Learning how these other languages do things can greatly help the R programmer — they can provide a great deal of perspective for those code-reading sessions you suggest.

  2. Bernhard says:

    Wow, three books on Lisp to become a better programmer in a programming language that does not lend itself to recursion programming? Three books on Lisp and not one on object orientation? Three books on Lisp and not one on algorhythms?
    I totally agree that learning a strictly functional language (in my case Haskell but maybe books on Lisp are better) can help a hell of a lot with R. Still, one can overdo a good thing. There is so much to learn and so litte time…

    By the way: Could somebody out there write a good tutorial on C++ for the R and Rcpp-User?

  3. Josey says:

    Wow, three books on Lisp to become a better programmer in a programming language that does not lend itself to recursion programming? Three books on Lisp and not one on object orientation? Three books on Lisp and not one on algorhythms?
    I totally agree that learning a strictly functional language (in my case Haskell but maybe books on Lisp are better) can help a hell of a lot with R. Still, one can overdo a good thing. There is so much to learn and so litte time…

    +1

Leave a Reply