The Best Way to Get Better at Coding (And Save Yourself Years of Struggle)
When I studied music, I went through so many exercises I can hardly recount them.
But I can tell you which one helped me improve the most:
Transcribing.
In music, transcribing means picking an instrumental part (a solo, a melody, a bass line, anything really) and learning it by ear. It means sitting in a quiet room and repeating the same 10 seconds of audio, sometimes at 50% speed, until you get it right.
It means copying — imitating — your idols, note for note.
If you do this, you won’t only learn their techniques; you’ll also teach yourself to think like them, to come up with similar ideas.
In 2020, when I started to code, I wondered how I could transfer transcribing to the field of programming.
The answer’s straightforward.
- You pick an open-source repository, ideally of a reputable project many skilled devs (idols) spend time on.
- Without relying on guides or documentation, you read their code and try to find out how the damn thing works. (Pro Tip: use a debugger to step through the code paths while the app runs.)
- You create a mini version yourself — no copy-pasting allowed. Solve the problems on your own.
I do this as soon as I have learned the basics of a new technology.
For example, I’ve picked up Go in March 2024. Once I had learned the basics, I checked out GoTrue, an open-source auth API, and studied and imitated a few REST handlers. I learned how to design a web server, how to organize packages, how to write idiomatic code, how to handle errors, and more.
Reading documentation or watching courses teaches you the vocabulary of the language — methods, keywords, data types, etc.
But it won’t teach you to speak it fluently.
It won’t teach you to assemble smaller parts into blocks of code and to solve real problems.
Imitating the approaches of more experienced devs and solving the same problems they have solved, on the other hand, will.
So, if you want to stop fumbling with vocabulary, if you want to stop struggling and wondering how to approach problems, and instead learn to speak, do what children do:
Imitate. Transcribe.