If you are trying to learn programming by implementing something new, you are conflating two skills and making it hard to do either of them well.
Yesterday, when I wrote about deliberate practice, I listed the two things you need to do to make practice effective
- Break it down so that you are practicing one thing and trying to make it automatic
- Set it up so that you have instant feedback on whether you are doing it right
As you work on your program, sometimes you are thinking about the syntax of the language and sometimes you are thinking about where to go next. It’s better if you can stay in one mode for a long period of time until that skill becomes automatic.
And, since there’s no set goal, it’s hard to know if you accomplished it. You have no objective feedback.
I remembered that in a recent Under the Radar episode, Marco Arment and David Smith talked about cloning apps as a learning exercise.
By cloning, we can concentrate on just coding without having to come up with the content too. Even this can be broken down further. Structure your practice sessions to concentrate on one aspect at a time. For example, just the UI.
You can think of the target app as an executable spec, which is easy to compare your work to. If you are learning UI programming you can screenshot both screens and flip back and forth between them to see how close you can match it. This establishes instant feedback.
I recently tried this exercise for the Breathe app on the Apple Watch, only working on the animation and wrote up a SwiftUI animation tutorial on App-o-Mat.