The First Computer Bug and why Debugging

The First Computer Bug and why Debugging

Hey there,

In the past few days, I have been seeing here everyone is talking about debugging. I like the way Hashnode gives these writing goals which indeed will result in more technical writers. So here I am talking about the Debugging too. But let's talk a little about the origin story too.

In the early days of computing, programming was really different than they are today. The process was called Manual Programming and it was really hard as compared to today's standards. The programmers used to write programs on paper and then they had to translate them into binary code by hand, this process was really time consuming and prone to mistakes. Also, as a result of this, we needed often to look and check where our programs were giving the wrong result then fixing it and called this process debugging.

The term 'DEBUG' is originated around Grace Hopper. Born in 1906, Hopper loved taking things apart to see how they worked, and she was very good at math and science. Also earned a PhD in mathematics from Yale University. During World War II, she joined the Navy and worked on a big machine called the Harvard Mark I, one of the first programmable computers ever built.

The Harvard Mark I, also known as the IBM Automatic Sequence Controlled Calculator (ASCC), was one of the earliest and most powerful electromechanical computers ever built. It was designed and constructed by Howard Aiken, a professor at Harvard University, in collaboration with engineers from IBM.

Hopper had to figure out how to tell the computer what to do, which was really hard because back then people didn't know much about computers.

But she did it! She even wrote a book about it.


It was on Harvard Mark II that Grace Hopper made one of the most important discoveries in the history of computing. Debugging.

One day in 1947, she was working on a Mark II at Harvard University. She encountered a particularly vexing problem. The computer had mysteriously stopped working, and Hopper was tasked with finding and fixing the issue.

After hours of poring over code and puzzling over the machine's inner workings, her associates discovered a moth that was stuck in a relay and impeding the operation of the computer.

Hopper then removed the moth, taped it to a piece of paper, and wrote "First actual case of bug being found" on the paper. She then presented the paper, complete with the dead moth, to her colleagues as evidence of the issue.

The incident quickly became the stuff of legend. Hopper's colleagues found the dead moth amusing and hung it up on the computer's logbook as a memento. The term debugging was coined to describe the process of finding and fixing errors in software, and the concept quickly caught on.

After the war, Grace worked on other important computers and came up with new ways to make them work better. She also invented something called a compiler which made it easier to tell the computer what to do using words instead of numbers. Grace was a really important person in the history of computers, and she showed that girls can be really good at computer stuff too!


but why debugging?

  • Debugging is like hacking into your own code, finding the vulnerabilities and fixing them before someone else exploits them.

  • It can be frustrating when we can't find the problem right away, but it's also really rewarding when we finally solve it.

  • It's about understanding the flow of data and identifying where things went wrong.

  • It's an important skill to have if you want to make your own computer programs or games someday.

  • Ultimately, debugging is about delivering a quality product and ensuring that users have a seamless experience.


Now when I started thinking about the bugs which made me lose my calm is many and some are so naive which will make most of you laugh. So, I am choosing one which happens more often. The code along ones.

Whenever I get time, I try to learn new programming languages and frameworks by watching YouTube videos. I'd get my coffee, my laptop and settle in for what I thought would be a productive evening of coding.

But no matter how closely I followed the tutorial, I always seemed to get stuck at some point or end up with different result than the tutorial. It is really frustrating and demotivating at times, as I couldn't figure out why is not working as intended.

After all this time, one thing I realized is that tutorials I was following were often outdated or incomplete and the code they provided was not always applicable to my coding environment or the project which I am trying to build. I also noticed that often to declutter or make it short sometime the instructors choose to skip some important points as they assume that their viewers had some prior knowledge or experience.

But instead of giving up, I decided to take a different approach. I started to use the tutorials as a guide rather than a step-by-step instruction manual. I would pause the video at key points, research the concepts being taught, and try to apply them to my own project in a way that made sense for my specific needs.

It wasn't easy, but over time I began to gain a deeper understanding of the code and the language itself. I also believe that doing DSA questions helps to develop our own problem solving skills and by tinkering around the code I learned to be good at debugging.

So I guess, instead of copying the video step by step I started to try things out on my own and figure out how to solve the bugs. I found that making mistakes is part of the learning process, and that it's okay to try things out and see what happens. Remember that bugs is an opportunity to grow and improve as a coder. Happy coding and debugging!

Did you find this article valuable?

Support Nishant Kumar by becoming a sponsor. Any amount is appreciated!