Can you implement a stack off the top of your head? How about a simple hash table? A recursive descent parser? Can you do it without thinking about it?
These are a few programming “etudes“. Musicians have a tradition of etudes designed to teach fundamental lessons about playing their instrument. They practice them (usually as children) until they can play them perfectly from memory. Just like with the programming examples above, a musician doesn’t play these etudes in “the real world”. They’re technical exercises so that when they get on stage they can make an artistic statement rather than worrying about fingerings.
A pianist practicing an etude may focus on alternate fingerings, dynamics, tempo. What are equivalent variations you could try while doing a matrix multiplication “etude”? Elegance? Performance? Generality? Obfuscation?
Build your own set of programming etudes. Practice them. They’ll make you a better programmer. Now repeat in another language.
Can you minimize key strokes in your editor? Try it in a different editor?
Can you design a series of etudes that build on each other? Maybe it’s like programming a fugue? Linked-lists + a hash function becomes a hash table. What’s next?
Can you think of etudes in your favorite framework? The “fifteen minute blog” is one. See, it doesn’t have to be all about data structures and algorithms and clever interview questions. It’s about getting the tools of your trade under your skin.
Now go read Dave Thomas’ CodeKata.
Practice, practice, practice!!