You learn a lot being a high-performance oriented classical musician. Here are some lessons I learned along the way, especially in how I needed to practice so methodically to have any hope of making progress, which may be helpful to people as they learn to code.
1) Isolate small, difficult sections
- If you are having difficulty in a section of music, you don't go back and practice the entire piece over and over again. you isolate the measure (which is a very tiny segment!) of music you are most struggling with and practice that. You work smaller and smaller even until you can play it without getting it wrong. The same goes for coding. If you're struggling with a leetcode exercise, are you struggling with arrays? Objects? Maybe control flow? Go back and practice some short exercises focused on that one thing you are struggling with until you absolutely cannot get them wrong.
2) Practice until you can't get it wrong.
- Don't practice a section of music until you get it right. Practice it until you can't get it wrong. The same goes for difficult concepts in code. Don't just do an array exercise until you're like "oh, ok I got one right, I guess I understand arrays now." Do array exercises until you literally can do them in your sleep. That's not to say you need to memorize every array method ever, but you should understand in-depth how arrays work.
3) Simple and good is better than complex and a trainwreck.
- When singers audition, there is a lot of temptation to do a big, showy, frilly piece; however, those pieces can be exceptionally difficult and not necessarily showcase the singer in the best light. It's better to do a simple piece in the audition, but executed flawlessly, than a showy piece with lots of mistakes. Same with code, I think, is that its better to have solid, amazing basics and stretch from there in your work (of course, balancing this with pushing yourself forward is important), rather than biting off huge chunks of very complex projects that are way beyond your skillset and will ultimately lead you to get discouraged.
4) At the end of the day, you're telling a story.
- I think this one is the most ethereal tip, but in classical music, as obsessive as it is on technical perfection (and I'm not kidding when I say perfection), your job is to tell a story through the sound of your voice and your technical chops serve that end. I think the same thing in code is important; keeping in mind that working code is better than perfect and that if you can't serve the end-user with your work, then something is off.
And yes, you can hear me sing; in a live performance of Poulenc's Gloria:)