Teaching coding in higher education

Coding workshops with github repositories

To me, coding is an important element of research. It gives you the freedom to explore your data and design your analyses to fit individual experiments. It allows you to share your code and data.

I have taught two workshops on R and RStudio. Both workshops were designed for beginners new to R. You can take a look at the github repositories for both workshops (links below). They contain lessons, objectives, and code for each workshop.

Why is coding important?

Increasingly, coding is becoming central to science in conducting statistical analyses and managing data. In contrast to proprietary software, coding is open source allowing for anyone to create and share code to fit a variety of research and, other than needing a computer, is cost-free. Additionally, coding teaches critical thinking and problem solving skills.

Challenges

While there are numerous sites that offer lessons on how to code, there is very little information on how effective the methods used within these lessons are. As this is a new area that relies heavily on the usage of technology, effective teaching methods need to be evaluated. Here are some of the challenges faced:

  • Variable experience levels

  • General feelings of uncertainty and anxiety

  • Coding is subjective and interpretive. There is usually more than one answer and one method to reach the same answer.

“One does not expect anything to work at the first try. One does not judge by standards like ‘right—you get a good grade’ and ‘wrong—you get a bad grade’. Rather one asks the question: ‘How can I fix it?’ and to fix it one has first to understand what happened in its own terms.”

-Seymour Papert

Peer instruction

While on-on-one tutoring is ideal as it allows focused and personalized attention and feedback, it is impractical in large college classes which can have upwards of a few hundred people. Peer instruction is an effective alternative. In this method, the instructor presents code or a question and allows students to pair off and discuss. This forces students to explain their reasoning and think through the problem actively instead of passively being told by the instructor.

Another version of this is paired programming in which two students pair off—one doing the typing and the other offering comments and suggestions—and work together to write code. The two students should switch roles several times over the course of the coding. This allows students to help each other, see how other's think about a problem, and help clarify misconceptions.

Formative assessment

By using methods of formative assessment, the instructor can understanding. Evidence indicates though that this form of assessment is better if they don't cover simple factual recall, but instead predict outcome of code or probe for misconceptions.

Live coding

Live coding during instruction rather than lecture (i.e. slides)

  • enables instructors to be more responsive to questions,

  • allows students to see how the instructor 'does' coding,

  • slows the instructor down,

  • allows students to diagnose and correct mistakes, and

  • lets students see that mistakes are okay.

Some things to be careful about in live coding are not to move too slowly and not to rely on predetermined code, but rather work from objectives creating code as you teach.

References:

Raddon, M.E., R. Raby, and E. Sharpe. 2009. The challenges of teaching qualitative coding: can a learning object help? International Journal of Teaching and Learning in Higher Education 21:336-350.

Brown, N.C.C. and G. Wilson. 2018. Ten quick tips for teaching programming. PLoS Computational Biology https://doi.org/10.1371/journal.pcbi.1006023.

http://jarednielsen.com/teach-adults-code/

Software and data carpentry is an open source program dedicated to teaching computing skills. Their blog has lots of teaching advice from experienced instructors https://software-carpentry.org/blog

Milne, I. and G. Rowe. 2002. Difficulties in learning and teaching programming-views of students and tutors. Education and Information Technologies 7: 55-66.