DEV Community

Cover image for Pro Tip: Learn to love bugs through understanding
teamradhq
teamradhq

Posted on

Pro Tip: Learn to love bugs through understanding

After squashing some bugs today, I remarked to a colleague how much I enjoy solving bugs. They were a bit puzzled at why somebody would enjoy that special kind of trauma, which stimulated a few philosophical thoughts about bugs and idiots...


1. There is no such thing as a computer bug

100% of bugs originate between the computer and the chair.

This is a really important concept to understand: Computer bugs don't exist. There is literally no such thing as a computer error.

  • A bug is not a computer error, it's a human error.
  • A computer cannot make an error, it does exactly what it's told to do.
  • If a computer's computations yield unexpected results, it's because some human made a mistake.

It's important to not only understand this, but also believe it wholeheartedly. It's impossible for a computer to make an error. It just does what some human told it.


2. This is because computers are stupid

By computer standards you are Skynet.

Computers have a real way with making you feel stupid when they don't do what you want. You have to remember, you're not the stupid one in the equation. Compared to a computer, you possess super-intelligence. Even if you're not that smart, by human standards.

If you can't understand what the computer's telling you, it's because:

  • The computer is incapable of telling you anything.
  • Some error cause at a lower level is not being handled appropriately.
  • This means there's nothing - beyond a stack trace - to give you meaningful context.

Always remember this. The computer's not doing what you tell it to because you're stupid. It's doing exactly what you told it to, because it's too stupid to understand the nuances of your statements. Realise that it's doing exactly what you told it to, you just need to take more time to dumb it down even further so that your code describes your vague intentions with precision.


3. Humans can also be idiots

There are many kinds of idiots in this world:

  • Clever idiots
  • Stupid idiots
  • Lazy idiots
  • Productive idiots
  • Idiots from the past
  • Idiots from the future

To name a few...

There's nothing wrong with idiotic behaviour. It's really really hard to articulate vague concepts with precision. In fact, stupidity is often a requirement to getting anything done at all, because of point 2. Computers are stupid, so we frequently have to find the dumbest way to say something that it can actually understand.

Try not to be an idiot as much as possible. And whenever you encounter idiots in your travels, be kind, because...


4. Quite often, you are the idiot

There comes a point in every engineer's life when they're reviewing some defect in a system and they mutter this mantra to themselves for the first time:

What idiot done this?

Typically, they'll be scratching their head, shaking it in disbelief or stupidly smiling at the screen. Over time it's exceedingly common that, when one composes oneself, they discover that they were the idiot that done this.

You have to accept that this is part of the life that you've chosen to live.

Past you is not an idiot.

  • They just don't have the knowledge you possess to know their choices are idiotic.
  • They had no practise doing the kind of implementation that you've done countless times.
  • They were smart enough to feel clever but too stupid to know that they're not.

Be kind, and when you're not the idiot from the past, be kinder still.


5. Be kind, take your time

This is super important!!!

No matter how critical an issue is, take as much time as you need, and be kind and understanding to any stakeholders you're engaged with.

Just remember:

  • Whatever issue is occurring is extremely disruptive to them.
  • This triggers a sense of urgency that can often lead to an emotional response.
  • Disregard negativity for now and validate their concerns.
  • Reflect on behaviour later determine whether you need to address this with them.
  • Focus on the task at hand.

Again, this is really important.

You need time and patience to defeat the unknown. If you maintain good relationships with your stakeholders, the space you need is easy to find. Even if you're not a very social or communicative person, if you understand how to display empathy and sympathy to the people you work with, you'll be fine here.


6. Being authentic

For me, this means being positive, about everything. If you have no idea if a thing is going to work, communicate this. If you're worried or stressed about the thing, say so.

Being authentic is the difference between saying:

It can't be done.

And:

I don't know how it can be done yet.

The first statement is absolute and final. It's maybe even a little negative and defeatist, showing some insecurity in the speaker. The second is open and authentic. It's optimistic and hopeful. Both of them mean exactly the same thing, it's just that the first one obfuscates the speaker's lack of knowledge.

By admitting the speaker has no knowledge, they're displaying confidence in their abilities to solve problems. After all, your job is to implement solutions to problems. If the solutions were already known, then you wouldn't have a job!


7. When in doubt, hit it with a hammer

I cannot stress this enough, if it's already broken, then break it some more!

I don't mean this in the lame "Move fast and break things" kind of way. See points on idiocy if you want to know what I think about that philosophy.

I mean to say that, most of time, you're encountering some kind of problem that somebody's solved before. Even if it's unique, the problem will fall into some domain that somebody's previously encountered.

There will be tools... Lots of tools... Use all of them like a hammer.

  • Use git bisect to isolate where the problem was introduced.
  • Output a bunch of debug log messages.
  • Set breakpoints.
  • Die and dump.
  • Write tests.

If you keep bashing your code over the head with a hammer, eventually it will talk and tell you everything you needed to know.


Conclusion

These are just some random points that came to mind today about bugs and human errors. Remember, you're a sophisticated human dealing with idiotic machines.

Top comments (0)