Errors and using your ear

I had a new interview experience this week. I did a more traditional whiteboard style technical interview, which is something I hadn’t been asked to do before. It was an extremely educational and vulnerable moment for me because it made me realize what has become a part of my process and what I am reliant on when I solve coding problems. Specifically, using the errors and tests to solve problems.

Last week, I posted something about my experiences as a musician and learning in public. I can draw a nice parallel between this and being reliant on the sheet music. There is a relatively accurate joke about “How do you get a guitarist to be quiet? Put sheet music in front of them” that I see or hear relatively often, and there is a grain of truth to that. But for me, it wasn’t a problem. Part of studying for my degree with Doug Niedt was learning how to read, and sight-read, extremely well. So, if someone put music in front of me, it wasn’t a big concern. I would say all in all, it was a huge net positive, but there were some times when it was a hindrance.

When I am coding, I clearly like to build and run things to see what errors there are, and work from there. This is probably fine in most cases, and I was taught this way, both at Turing and through my own private study (especially in the C# Microsoft Learn things that I have done), but when that option is taken away, it made me a little more (or a lot more) self-conscious about what I was doing. I think in Ruby, it wouldn’t have been a big deal, but this was in C#, and I have learned that I still occasionally mix up the syntax with that and Go (which I worked in all summer) when I don’t have something pointing out a compiler error. After the fact, I made an example for myself to look at, so I can really see what the difference is and figure out what I was taking for granted using the errors.

C#

class Program
{
    static int Add(int a, int b)
    {
        return a + b;
    }
}

Go

package main

func Add(a int, b int) int {
    return a + b
}

So I would say that these look quite similar. When I was switching between the two, I made a conscious note that in C# int goes first, and in Go it goes after. Easy enough. What I hadn’t paid attention to (but am now) is when semicolons are necessary (emphasis to drill this into my brain). I would say more often than not, I get them right, but if I don’t then an error tells me, and I fix it. Well, when I can’t run that and just have to write it out, I don’t get that option and really start to second guess myself. So my task for the foreseeable future is going back and doing technical problems (hello exercism.com) and solving the entire thing before running it. It is only a slightly different approach from what I was doing, but should prepare me for next time this happens.

So how do I tie this to music, in my brain? Well, as I mentioned a week ago, I have been on a quest to use my limited amount of practice time to learn mostly by ear, and more importantly, memorize things that I would otherwise normally read. When I was gigging, I probably had too much music to try to memorize everything, and that was fine. Now, I can learn these melodies and internalize them, so they really stick. This has allowed me to focus on all of the intangible things in a melody that cannot be written down on a piece of paper, and you can only learn by ear. And so far, I am learning these things much quicker than I would have if I was learning it from the sheet more than from my ear.

So, my friends who are also interviewing, make sure to practice your technical problems this way as well and don’t be reliant on just running it to have the errors, failed tests, etc. point out what to do next. Because I learned the hard way that it is not always possible.

So, here is what I did from learning the melody for Scrapple from the Apple this week. I decided to do it now, because I have been feeling under the weather and it seems to be getting worse. True to the learning in public thing, here is the head for Scrapple from the Apple, I just recorded a few times and cut the best one out, with no redoing it. It just does that A part 3 times, the B section is open, so I played A three times, and did the first turnaround twice because that was the one I usually messed up.


Comments

Leave a Reply

Discover more from Brendan Bondurant

Subscribe now to keep reading and get access to the full archive.

Continue reading