Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

README.md

Code review

The students individually program an assignment and then review each other's solution.

Parameters:
Duration: 10–50 minutes
Participants: 4–20 students
Instructors: 1 teacher
Class: PCs
Resources: programming assignments
Prerequisites: being able to code the solution

Learning outcomes

  • Read and evaluate code of other students.
  • Understand the importance of writing readable code.
  • Learn approaches and mistakes of other students.

Setup and preparation

  • Prepare a programming assignment that different students will program differently (multiple approaches for functional decomposition, choice of the data structure, etc.). Example assignments include:

Activity overview

  • Explain the best practices for writing readable code. This includes style and specifics of the given programming language, such as PEP8 for Python or Google Style Guide for Java. It also includes general principles of programming, such as these.
  • Let students program the assignment.
  • When two students finish, they sit together to read and understand each other's code. Then, they compare and discuss which code is 'better' and why (better naming of the variables, better input sanitization, lower complexity, better readability, ...).
  • After the discussion, the two students merge their codes to create one 'best' solution. Merge two pairs and repeat the previous step.
  • [Optional] Repeat the previous step to merge two groups of four.
  • The groups present their single solution and comment on why it is the best. They can also present their mistakes and how to avoid them for the future.

Tips and tricks

  • It is better to introduce this activity when students are more familiar with the programming language.
  • Make pairs in a way that weaker students are with those more able, who will explain their mistakes.

Related material

Author

Jakub Žák, 2019