
We know that practice is important. And we need to maximize our learning from what we do. But if you really want to up the ante, we need to tighten the constraints on how we do it.
What does that even mean? How would we do that? We tighten the constraints by setting a further limitation on how we do what we do. Body builders will maximize the muscle growth by making all of their movements very slow and controlled. During the “Day of Code Retreat” a simple problem is given to the attendees: implement the Game of Life. But don’t use “if” statements. Or don’t use loops at all. Or any of a dozen other limitations. This maximizes the learning for the day. You have to find creative ways to solve the problem, and you have to collaborate on how to make it happen. It’s a powerful experience that I recommend you try.
But what if you’re learning a new language? What would that look like? You could try using a simple text editor so that the IDE doesn’t help you with syntax and spelling. You could try writing a program that uses every language feature you have learned so far. You could translate an existing program from a different language to the new one following proper idioms for the new language. Or just combine two ideas. Write a simple program in the new language, but don’t use “if” or loops. You’ll have to be creative and persistent!
Converse to the body builders, chess players will set a timer so that they have to make their next move within five seconds, or forfeit the game. They quickly learn a large number of scenarios this way. You can do something similar by setting a hard time deadline on completing an exercise. This is a way to maximize the learning in a compressed time.
When writing unit tests, Kent Beck introduced the idea of “test && commit || revert“. Basically, if your test fails, your code changes are completely reverted back to the previous working test and you have to start over. It forces you to think harder about what you’re doing and, more importantly, keep your changes very small!
There are ways to tighten the constraints on whatever it is you are practicing. What are you practicing? How can you tighten the constraints on it?

