Do you play word games like crosswords or word searches? Experts say these strengthen the brain because they make you think from unique angles about how words and letters are associated.
Turns out we can also build “word games” when it comes to code, and these can also be great mental exercises.
What are Parsons problems?
Parsons problems, named after one of the originators of the exercise, are coding challenges where learners must re-arrange a series of lines of code in an order to achieve some purpose.
What are the benefits?
Parsons problems have lots going for them:
- They are interactive. Students are inclined to move around the blocks and try different answers.
- It avoids the “blank screen of terror.” With something already on the screen to engage with, students are less likely to give up or skip ahead.
- It isolates concepts. With a pre-defined problem, students can focus on specific concepts like control flow and code efficiency, rather than naming and assignment variables from scratch
- It builds good habits. Because the code is pre-defined, the end result when correct will be a well-constructed piece of code. Students play an active role in helping to build good code, rather than haphazardly stumbling through suboptimal code on their own.
Demo: Parsons problem
I have a small demo of how Parsons problems work below. Feel free to download the PowerPoint slide to try it yourself! This problem is in the Python programming language.
A couple of things to notice about the example:
- Distractors, or incorrect options, are possible.
- Some programming languages, like Python, are indented. The Parsons problem should accomodate for this.
Building Parsons problems
Parsons problems can be done somewhat effectively with a plain old PowerPoint slide, or even by printed lines of code. There are also ways to auto-grade them: for example, check out the js-parsons
JavaScript library.
Leave a Reply