With this article, we want to honour the birthday of the first real debugging 🪲 🗑. Therefore our colleague Mansour shares a story of his life as a developer. It is about how he suspected the whole company he worked in systematically stole laptops just because of one tiny bug. But read it for yourself. Enjoy!
Want to solve a bug? 🪲🐞🪳
Do it as Harvard computer scientists did on September, 9th in 1947. Search on your Hardware!
The team was working on a Mark II computer and it was delivering errors, over and over again. Not being able to solve the problem in front of the screen, they decided to check the Hardware and there they found the bug 🪲! A real one: a moth! That insect has caused interferences with the computer's electronics. This was the first case of actually debugging a system. In this team also Dr. Grace Hooper worked. She was one of the first computer programmers and maybe because of her, the expression of a “bug” for a glitch in a system did get famous 🤵♀️.
So until today, the expression is being used and systems have to be debugged. “Searching for a bug” takes part in the daily life of every developer 🐛.
Same as in the Story of Mansour:
Being a software engineer is wonderful, but occasionally, every programmer discovers weird bugs in the software he uses or develops. This is my story about a bug that I discovered during one of my projects.
Back in 2014, I was still a junior front-end developer and I worked on a customer dashboard based on AngularJS 👨💻.
The customer dashboard was about managing the user’s informations and their devices. We were using the Google Maps API to show our users the exact location of their devices if connected to the internet, or its last location 🎯.
Here is the moment that our story begins.
During the development of one of my tasks, accidentally I made a mistake!! The code I wrote was supposed to show the user’s device's current location. But instead, it showed our office location! And nobody noticed! So we updated the production without any doubts 🏖.
After several hours somebody knocked at the office door. It was a young boy with his girlfriend 👫.
The boy told our manager, “My girlfriend lost her laptop on the bus and one of your colleagues stole it, and I am sure about it. If you do not give the laptop back, I will go and come back here with a police officer.” Our manager was of course totally surprised at the accusation! He answered: “How you can be this sure? We are all software engineers in here, and we do not need to steal your girlfriend's laptop.” The boy replied confidently: “my girlfriend has an application installed on her laptop that shows the last location of the laptop, and the location of the laptop is HERE!” And he was right 👨⚖️!
Booom! What a charge! 🧨 💣 🚨
Our manager, nevertheless still very calm and collected, asked him the name of the application. And the boy named our application, the one I was coding on! What a riddle! But this information relieved our manager for the moment because it can only be a technical problem that has led the boy here. So he told him that he just entered the office of this company and that actually we are the developers who are developing this app. Therefore, it can only be a mistake in our service 🙏.
You think that solved everything? Not at all.
Immediately after the boy heard that we are the ones behind that application, the main problem started. “You are the thief!” he pointed out, “You track people's devices to steal them. I am going to sue you!". They left immediately the building. On their way out, he shouted: "I will come back with a police officer!” 🚔.
My manager, rather amused than nervous, came to me and asked me to check how this is possible. I went through the code, checked it and at that moment I realized that I made a huge mistake. I found a bug 🪲!
My manager asked me to resolve the problem immediately and push it to production as a hotfix 🔥.
After a couple of hours, the guy and his girlfriend came back, and they really brought a police officer with them. Wow, they were really serious about their accusation! The police officer called my manager and asked him to explain what happened and why these two young people think their laptop is here. My manager had to explain everything to the police officer, including the bug 🪲 I published . The officer accepted our explanation and asked if it’s possible to find the laptop's location now. We confirmed that if it is connected to the internet, we can find the location immediately. The girl then should be able to see it on her dashboard in our web application 🕵️♀️.
And it worked!
She was incredibly lucky because some good guy found her laptop bag on one of the bus seats and gave it to the bus driver. The bus driver gave the laptop to his manager in the bus main terminal. The girl then found her laptop at the main terminal after several hours 💝.
Honestly, our application wasn’t helpful at all in this story, instead, I put the whole company in serious trouble because I forgot to change a token value. And, of course, I had to spend money to buy ice cream for my whole team as an apology 🍦.
The moral of the story:
Never hard code critical values!