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!