You look through the code again, line by line. It doesn’t make sense, it should have worked perfectly. Everything looks right. But somehow it keeps throwing an error. What could possibly be wrong?
And then your friend comes over, and takes a look at your code.
“Dude you missed a semicolon”
One semicolon. One fucking semicolon. 2 hours of your life had been devoted to finding that one semicolon which your friend found in 2 minutes. And this was the millionth time you were making that same old stupid mistake.
Every programmer would have encountered this at some point. Regardless of numerous years of experience, every coder experiences this. Some even fear it. Some loath it. But it is always there.
The Bug.
A bug (in the programming world) is defined to be an error or a glitch in the code, which results in the code not running as it is expected to. These errors can be very minor ones which leads to some minor glitches in the program (, or big enough to crash the entire system (or when an app crashes on your phone). What causes these bugs? Us humans of course.
So the only means of fixing the bug, is through the process of debugging. Look through the entirety of the executable code, to find the one mistake which led to the error. Beneath the layers of executable operations, the core of the error lies somewhere deep beneath, at a fundamental level. The error lies in the human.
Computers are perfect beings, they make no mistakes. They compile and execute programs flawlessly, to the maximum capabilities of its hardware. Humans however are very imperfect beings.
To err is human
We pride on our ability to make mistakes. We are flawed beings. Every single one of us. In a very unique way. Almost in a predictable way.
If you were to take a step back and map out every bug on your code, you could certainly map out a pattern in the kind of errors that you make. And more often than so, one is never able to find one’s own mistake. It is always easier to spot the bug on someone else’s code as compared to finding it in one’s own.
Putting this in a broader perspective, as humans we tend to keep making the same mistakes over and over. An alcoholic goes back to alcohol again and again despite the numerous times he has suffered from it. A smoker does not quit smoking regardless of detrimental health effects. An abusive husband continues abusing regardless of promising not to. The errors keep appearing again and again, because the human never sees them as an error. They have perfect explanations for acting the way they do. But to everyone else, the error is glaringly obvious. It is right there in your face, why the hell doesn’t she realise that she needs to break up from this guy? Why does he not want to quit his job despite being treated so badly? Everybody else can see this mistake, but the person committing them.
Until they decide to debug.
And to debug, is to truly sieve through the multiple layers of executions, and arriving at the core reason, the fundamental nature of the being, and fixing that. It needs numerous “why”s, incredible amounts of patience, and constant searching, to be able to arrive at the core.
Could be a past failure, a broken relationship, loss of a friend, which leads to the minor glitch, which over various layers, affects other operations and decisions, building up over time, resulting in the undetectable flaws that we execute today.
So debug, and keep debugging. And be open to criticism. Cause some of the biggest flaws tend to be invisible to us.
And in the process of debugging, keep glitching.
Cause that’s what is gonna give you clues as to where to debug.