Threshold concepts are those ideas where you have an 'ah ha' moment. Everything suddenly becomes clear, and yet (somehow) you still can't really explain it to anyone else... we want to try and overcome that last part by re-imagining problems visually, rather than in a traditional abstract/logical space.
We're working on a series of visual problems for all levels; covering everything from simple for-loops, to recursive Classes and Objects. The current plan:
- Pick a target concept (e.g. flow of control, recursion, abstraction etc...).
- Create a range of Python-Turtle problems that focus on that concept.
- Create solutions to every one of those problems. Record those solutions in action to help with step 2 and 4.
- Explain why each solution works the way it does.
- Repeat from step 1.
Each iteration of this process will be converted into a dedicated chapter of our upcoming book - Visual Python - and each one will get a set of video lessons to go with it. Because of this iterative process, we'll also be uploading mini-courses to SkillShare, so you don't have to wait. Leave a comment below, or sign up for free, and we'll keep you updated on progress.
In the meantime, hopefully, you can take the idea of visualizing problems and use it to help you think about a problem/concept you've been stuck on in a new way.
An example Threshold Concept
Variables and flow of control are both, surprisingly, threshold concepts (I say surprisingly, because to an experienced dev they are second nature). The example below assumes the student understands variables already, and tries to explain loops by changing the turtle's size for each iteration (and changing it's color at the end). Student's should be able to see what happens, and when, more easily. And if a student still has trouble, mini visual problems like this are excellent for experimentation.
import turtle current_size = 1 for corners in range(4): current_size += 2 turtle.shapesize(current_size) turtle.forward(100) turtle.stamp() turtle.right(90) turtle.color("red") turtle.mainloop()
One idea at a time though, please
The below snippet draws what's called a Gosper Curve using the Python Turtle. It's visual, it's pretty, but it's no good here... what this example hopes to demo is that while several concepts can be shown at once, it isn't necessarily a good idea if the visualization doesn't clarify anything. This example makes use of at least 3 threshold concepts:
- Lambda Functions
There's a better-than-good chance that until you hit Run below, you won't be able to predict what will draw... regardless of if you've overcome the above thresholds. And that doesn't help anyone. But, the same problem, framed differently, could be much more useful. For example, we can avoid the complexity of recursion by using string.replace() several times to create a verbose string of instructions. That string can then be shown to the user so they can see how it grows. With the instruction set fully populated, you can then loop over each instruction with a simple linear if-else.