DEV Community

David Kamer
David Kamer

Posted on

Don’t Get Mad, Get 2 % 2 === O

Coding can get frustrating.

Frustration is something you can control, but it can be a hard sell when you’re facing numerous deadlines–and your code isn’t doing exactly what you expect. Your hopelessness can easily increase when you search for solutions.

Searches can end a few different ways. One way is you find your answer. Usually, in this case, it’s something you’ll feel is obvious after you see the answer. There are rare cases where it’s “re-initializing the quantum field generator” or something equally ridiculous, but we’re on the topic of problems that boil your blood.

Another way your search could end resembles the path a bad ARG (Alternate Reality Game) would take. You find clues to your answer, like it’s a scavenger hunt, but you never really find an answer that makes any sense for your current problem. Congratulations, you’ve either found a problem that no one has ever encountered, or you’ve found a problem that no one felt the need to share the solution to. If it’s the first you might be working on something ground breaking (or hacky), and if it’s the second you might be working on something that only 1337 coders can solve (definitely something hacky).

So now you have to solve your own problem. But you’re a smart dev, right? You obviously only searched the problem because it’s really technical and not something that requires your problem solving skills, right? Wrong, you searched it because it’s easy to solve 99% of the low hanging fruit that way, but you’ve now stumbled on either 1% of the low hanging fruit or a problem that, shockingly, actually takes some knowledge and experience.

Now, experience is sort of a chicken and egg thing. You can’t have experience without building up experience, and you don’t build experience by showing up to work. This isn’t an RPG where you can left click on something and your XP magically accumulates. No, you gain experience by doing the things that are difficult.

Your brain probably already knows this. You may even tell yourself this. But remember, you’re working against several deadlines and the clock is ticking. So what does your instinct tell you about this problem that has recently gained the categorical label “stupid”? It tells you to call the problem “stupid” and throw your coffee cup out the window.

Don’t do that.

I mean if you have to it’s better than posting edgy things online or mean comments on a YouTube video.

Anyway, anger isn’t the answer. Now don’t think the opposite is the answer either. Don’t start playing a violin as the ship sinks. Don’t get defeated. The reason you are a programmer is because you solve problems. These type of obstacles are what should get you out of bed in the morning.

If you feel defeated or if you feel angry, even after reminding yourself that you shouldn’t, don’t feel dissuaded. You can’t just flip a switch on your anger. Take a step back from the problem. Go read a book or take a walk if you have to. If you’re having a hard time controlling your emotions, maybe check out some Stoicism or something Zen, but right now, in the short term, just check out if you have to. Now when you’re not feeling angry and your vision is clear, don’t approach the problem directly.

David Wheeler – “All problems in computer science can be solved by another level of indirection”

Now this quote means something not directly relevant to your coding practices (sticking with the spirit of indirection), but it’s still relevant to what I’m about to tell you. You need to look at your code. Don’t look for your problem, go fix up your code. Look for all the possible errors and bad practices. Think about it, if you fix all of the errors and all of the bad practices, you indirectly fix the error that is blocking you.

You – “Jeez, thanks, I guess I’ll just go fix all the errors now, some help”

No, It’s not about fixing all the errors, it’s about widening your perspective. Don’t beat your head against the wall. Use your brain to make the code better. Odds are the problem isn’t a problem you’re naturally going to see. After all, you would have already found it if you’re (already) wired in a way to do so. As you move through your code, you’ll get a better idea of how it works as opposed to how you intended it to work. You’ll learn quite a bit about yourself and the mindset you had when you wrote the code.

Marcus Aurelius – “Waste no more time arguing what a good person should be. Be one.”

When you approach your code with the right attitude, you’ll stop arguing with yourself (and the wonderful people over on StackOverflow) about how to do it, and you’ll just get it done. You’ll see your own errors and you’ll fix them. Anger is no longer an issue when you realize what’s in your control, and you avoid worrying about what’s not in your control. Don’t worry, just fix your code—all of it.

Also, did you catch the error in the title?

Discussion (0)