Coding Tactic: Give all variables a meaningful name
When you realize you’re changing the name of a variable in your mind, it’s time to seriously consider changing the variable name.
This might be a loop (e.g. change i
to attemptNum
)
It might be magic numbers (e.g. change 0 to ‘stopped’, 1 to ‘running’)
The second you make this change, your mind no longer has to swap the name while also trying to deal with the complexity of the problem. It gets to focus fully on the problem.