How to Study Computer Programming: Parsons Problems

Mike McMillan
The Startup
Published in
6 min readMay 23, 2020

--

Photo by Markus Spiske on Unsplash

A Parsons Problem is a complete, though usually short, computer program where the lines of the program are mixed up and the person solving the problem must put the lines into the right order. In this article I’ll discuss why Parsons Problems are good for studying computer programming and I’ll show you some web-based programs you can use to generate your own Parsons Problems.

A Short Parsons Problems Example

Here is an example JavaScript program demonstrating how to swap the contents of two variables:

let value1 = 2;
let value2 = 200;
let temp = value1;
value1 = value2;
value2 = temp;

We can mix this program up to make a Parsons Problem like this:

value1 = value2;
let temp = value1;
let value2 = 200;
value2 = temp;
value1 = 2;
value1 = value2;
let value1 = 2;

The student then takes this Parsons Problem and rearranges the program to either recreate the original version shown above or a variation where the variable initialization order is changed.

Web-based Parsons Problems sites allow students to solve Parsons Problems by either using line numbers in the program or presenting the code as a set of blocks that can be dragged and dropped into the correct order. I’ll demonstrate some…

--

--

Mike McMillan
The Startup

Mike McMillan writes about computer programming and running. See more of his writing and courses at https://mmcmillan.gumroad.com.