How to Take Notes in a Coding Lecture

Short answer: In a coding lecture, write down what each block of code is for and why the professor chose it, not every line they type. Then pick one example and trace it by hand with a small table of variable values.

Why copying code fails

Live coding moves fast. The professor types, deletes, runs the program, fixes an error, and talks the whole time. If you try to copy every line, you fall behind and miss the spoken part, which is where most of the explanation lives.

Researchers at Virginia Tech measured this. In a lab study of 57 students, Manesh et al. (2025) compared two ways of taking notes during two 15-minute live coding lectures. In one, students typed the code into an ordinary editor. In the other, they could copy the instructor's code into their notes with a click. Only 38.6% of the typists said they kept up, against 91.2% of the students who copied with a click. Typed notes held about 6.9 idea units on average, against 12.6. They also had more mistakes: 1.37 wrong code units per student, against 0.19.

Two cautions. Quiz scores did not differ between the groups, so the study found better notes but no better grades. And the click-to-copy tool was built for the study. You probably can't use it in your class.

The takeaway is smaller but still useful. The code is the cheapest thing to get later. Check whether your professor posts the files. Your notes should hold what the file can't: why each piece exists.

What to write instead

Write the goal of each block

Margulieux, Morrison and Decker (2020) tested "subgoal labels" in an introductory programming course. A subgoal label is a short phrase that names what a group of steps accomplishes, such as "set up the counter" or "stop when the list ends." The authors followed 265 students across a full semester. Half learned from worked examples with subgoal labels. Half got typical instruction.

The labeled group did better on quizzes taken within a week of learning each new procedure. Average exam scores were not significantly better. But the labeled group's scores varied less, and fewer of those students failed or dropped the course.

One limit: in that study the instructors wrote the labels. Nobody tested whether writing your own in lecture gives the same boost. It is a reasonable way to apply the finding, but it is not proven.

Note the why

"Loop through the list" repeats what the code already says. "Loop so we check every score, because we don't know how many there are" tells you why a loop was chosen. Professors often say these reasons out loud and never put them on screen. Those spoken sentences are the ones to catch.

Trace one example by hand

Xie, Nelson and Ko (2018) taught novices a simple tracing strategy: go line by line and keep a table of variable names and their current values. When a value changes, cross out the old one and write the new one beside it.

Their experiment was small: 24 students in an intro programming course, predicting the output of six Java programs. Students who got about five minutes of instruction on the strategy scored 30.0 out of 36. The comparison group, who used their own methods, scored 24.6. That gap was just under the usual cutoff for significance (p = 0.049, one-tailed), so treat it as a promising result, not a settled one.

Lecture is a good time to try it, because the professor often runs a small example anyway. A table of values is easier to read later than a pile of arrows and crossed-out numbers.

How to do it in class

  1. Set up the page before class. Put the topic at the top and leave room beside each section for a goal.
  2. Write one line per code block. When the professor starts a new chunk, write its goal in your own words. Skip the code if it will be posted.
  3. Copy only the key lines, such as a loop condition, a tricky formula, or a function signature. Mark anything that surprised you.
  4. Catch spoken reasons. When you hear "we do this because" or "the trap here is," write it down. Those sentences are rarely on the slides.
  5. Trace one example. When the professor runs the code, draw a small table with one column per variable and one row per step. Do it for one example, not all of them.

Short on time? Keep only steps 2 and 4.

Try it tonight: Open any code from today's lecture. Cover the comments and write one sentence for each block saying what it is for. Then trace the first example with a variable table. If you get stuck, that is the spot to ask about next class.

Common mistakes

  • Copying syntax you could look up in ten seconds.
  • Writing what the code does and skipping why. Your notes then repeat the code in English.
  • Tracing every example. Pick one; tracing takes time.
  • Never going back. Notes only help if you use them. The blank page method shows one way to study from them, and how to fix messy lecture notes covers what to do when class moves too fast and your page turns into a mess.

Sources

  1. Margulieux, L. E., Morrison, B. B., & Decker, A. (2020). Reducing withdrawal and failure rates in introductory programming with subgoal labeled worked examples. International Journal of STEM Education, 7, Article 19. https://doi.org/10.1186/s40594-020-00222-7
  2. Xie, B., Nelson, G. L., & Ko, A. J. (2018). An explicit strategy to scaffold novice program tracing. Proceedings of the 49th ACM Technical Symposium on Computer Science Education (SIGCSE '18), 344-349. https://doi.org/10.1145/3159450.3159527
  3. Manesh, D., Wu, T., Chen, Y., & Lee, S. W. (2025). Understanding and improving student note-taking in live coding lectures. Proceedings of the ACM Conference on International Computing Education Research (ICER 2025). https://doi.org/10.1145/3702652.3744224