Overcome Problems like a Rockstar Engineer

by Tommy Leung on May 2nd, 2018

All software engineers will eventually come face to face with a bug so mysterious that it makes them wonder if they aren't so good at their craft after all.

These are subtle errors in code that go unnoticed no matter how many times you look at it.

And they produce error messages that are even more cryptic.

Most bugs and errors can be solved within a few hours. Some even in minutes. But these are the ones that can take hours upon hours.

Sometimes days.

These are the bugs that separate the engineers you should hire first for a new company or project and those that you bring on later once a more suitable environment has formed.

"If you’re going through hell, keep going."

- Winston Churchill

Persistence, creative thinking, and belief plays an outsized role in resolving these bugs.

It can feel like being in a dark tunnel with no end in sight. You try and try to figure out what is wrong and how to fix it.

It can even feel like the problem is unfixable. Or that the real bug is related to something other than your code.

You might start to blame the compiler. The computer’s operating system. Some third party library.

And sometimes--in rare instances--the problem isn’t in your code. But the problem is still yours to solve.

People who wrote the compiler, operating system, or third party library don't care about your app as much as you do. You needed the problem solved yesterday. They have other priorities.

The only way through to the end is to persist and believe that the problem is solvable.

You start out in good spirits. This bug is mysterious but you will surely get some useful information once you spend an hour looking at it.

An hour goes by and it gets even more mysterious. You’ve learned little but another hour will almost certainly uncover something.

Another hour goes by and you are no more closer to a solution than an hour ago. Now you wonder if you should take a break or double down and just keep going because another hour will surely end up revealing the problem.

You fall into the rabbit hole and before you know it is the end of the day.

Good news! You’ve narrowed the problem to a specific place. That’s progress!

It’ll be much simpler tomorrow now that you know exactly where to look.

You start out the next day in good spirits because, even though it took many hours, you now have a decent lead.

An hour passes and you no longer feel so positive. You discover that seemingly unrelated parts of the code is influencing the problem.

You keep going for another hour and realize that you aren’t making progress any faster than the day before.

Now you wonder how long this will take. Is this problem even solvable?

But you keep going anyway because you’ve already spent so many hours on this. The sunk cost fallacy keeps you going.

"You may encounter many defeats, but you must not be defeated. In fact, it may be necessary to encounter the defeats, so you can know who you are, what you can rise from, how you can still come out of it."

- Maya Angelou

Then you get to a point where you are willing to try anything. Even the things that you were pretty sure couldn’t be related or are so farfetched as to be a waste of time.

And that’s when the breakthroughs start coming.

Now you’ve spent two days on this. The problem is still not solved but trying the absurd has kept it interesting.

Then in the middle of taking a shower, brushing your teeth, or doing something unrelated to engineering: the solution forms in your head.

Everything suddenly falls into place and the problem becomes crystal clear. Even obvious! The solution is elementary. It is just a matter of executing it now.

This is not unique to software engineering. This is life.

There are many problems that appear with no immediately obvious solutions. The problem may appear insurmountable. A solution impossible.

But is it?

If you believe that it is impossible then it certainly is. But if you believe that it can be solved and continuously tackle it from new angles then maybe it gets solved.

And maybe possible is all the belief you need to keep going.

"The first step is you have to say that you can."

- Will Smith

Believe. Persist. Solve.