Skill #3: Muscle Memory
Programming is a craft. It involves creativity and logic, yes, but it also involves using your eyes and fingers to perform tasks. It’s not enough to know what needs to be done, you need to be able to actually do it effectively.
You see this in other crafts as well. You might know the notes of the song you want to play on the guitar. Maybe you’re even a trained musician in a different instrument, and your brain is coming up with improvised melodies. But until your fingers know how to listen to your brain, you will not be a guitarist.
This ever happen to you? You come up with an idea: I need to check if the password string’s length is too short, and then pull up the error message if it is.
You’re pumped to write the code, but you stop short: How do I get the string out of that text box, again? Wait, is there a round bracket after the “if”?
These tiny questions are easily solvable, but together they hold you back from solving the bigger problem. It becomes frustrating for you to progress to more complex problems, because your brain keeps having to deal with these smaller issues.
If you’re having trouble actually writing the code, you have a problem with execution.
How do musicians train execution? They do drills. As a programmer, you want to do something similar.
Take problems you’ve already solved, and do them again. This time, there is no logic puzzle. You already know what the solution is. You’re simply training your eyes and fingers, and building muscle memory.
Doing drills trains you to very quickly spit out the code for a given idea. Want to compare a string’s length? if, open bracket close bracket, open curly close curly, move cursor back inside bracket. Boom. Now you can think about what the conditional should be, instead of how to write one.
Doing drills also trains your eyes to spot errors more quickly. You get more accustomed to what correct code looks like. So when you miss a semicolon, or a code block is wrongly indented, it jumps out at you immediately.
Drills make you faster at both coding and debugging.
As you do this for each new concept, more and more skills move to this subconscious level. Soon, your brain will be planning larger blocks of logic while your fingers spit out the relevant code.
Initially, simple concepts enter your muscle memory: brackets, semicolons, variable declarations. Soon, things like function definitions, class definitions. Then larger tasks, like adding a new screen to your app and wiring up the relevant code.
You can hold larger and larger problems in your head because your brain does not need to be distracted by the actual execution.
To get better at execution, practice the same problems repeatedly over time.
Know what to practice
When you’re stuck with a programming concept it can feel like you’ve hit a skill ceiling as a programmer. Practice is really the only way to progress past that. But it’s important to know where to focus your practice.
When you get stuck with a concept, use the guide above to try and identify which of these 3 fundamental skills is holding you back right now.
Focus on getting better at that skill, and you’ll smash through your skill ceiling in no time.