It's not as weird as you think!
On the latest episode of Not So Standard Deviations, Roger Peng brought up the idea of teaching R as somebody’s first programming language, a topic that Roger and I used to casually discuss. I want to clarify my take on those conversations, which to this day inform my thinking about understanding how people learn data science.
In contrast, many introduction to R classes never mention loops, if statements, R’s memory model, writing functions, or R’s many systems for object oriented programming. As Hilary Parker said in the podcast, research shows that somebody learning R as their first programming language is “not as weird as you think!” Introduction to R courses instead tend to emphasize the data science lifecycle, which means focusing on teaching students how to use software libraries that are not part of R’s core features to manipulate tables, create visualizations, and build statistical models.
I have never seen an introduction to R course that is structured like an introduction to Java or Python course, though if one did exist, I imagine it would borrow heavily from Hadley Wickham’s book Advanced R. The very existence of that book shows how in the R community topics like environments, namespaces, and object oriented programming are considered advanced topics. Compare this to the Python world where learning the core language features are introductory material, and then learning about how to manipulate, model, and visualize data are all subsequent advanced topics.
If I recall correctly, the reason that Roger and I were having these conversations about what an “Introductory R” course even means is because we were interested in creating more online courses about R. Eventually we teamed up with Brooke Anderson to build a series of courses and to write a book both called Mastering Software Development in R.
Finally, I want to talk about something Roger said towards the end of the conversation: “There has to be a moment where you really use [a programming language] in a production type setting.” This got me thinking about the difference between learning your first ever programming language, which teaches you how to think about code, and learning the first programming language that you will use to maintain or create production systems, which will directly impact your career. An undergraduate student taking an introduction to programming class does not expect to apply their programming knowledge in a production setting for at least several months. Perhaps they might get a summer internship, but typically it can be a few years before they are writing code for production systems. Compare their situation to a graduate student who is taking an “Introduction to R” course. In my own graduate school experience I know students who are expected to apply their new programming skills to research projects immediately after or during an introductory course. This difference in when a student is expected to apply their knowledge has certainly influenced what is considered “introductory” for R versus other languages. Those of us who teach data science should think more deeply about this difference in expectations and how it effects expository programming instruction for researchers.