Writing code for half a day and fixing bugs for a day is a programmer’s day. Bugs, big and small, are rife at work. Some are fun, but others may make you regret not getting a kitchen knife. When you find a bug, it’s like insulting intelligence.

The snail is a takeaway platform front-end engineer, temporary receipt of a large project, the original platform of the old code, part of the migration to the new platform. He is responsible for the logistics module is related to the code.

Under normal circumstances, the map of the delivery area should display the following effect:



However, in the actual handling process, people scratching their head is that no matter how to change, the effect is always a light blue map.



What is to be done? It is inevitable to encounter a bug in the development process. The terrible thing is that this bug comes from the map, that is, a third-party component library, and it does not work properly. You do not know whether the problem is your own problem or the component library problem.

In order to solve this problem, the running snail deliberately found the map, all the interface API documents, all looked through, and checked all the fields used, and compared the data on both sides.

However, there is no way to solve this “bug”, no matter how you play with it, the map display will always be a light blue background.

From the afternoon to the evening, toss about for most of the day, still unable to solve. Just when he was still in doubt of life, accidentally, met the mouse wheel, so the map narrowed, suddenly found that the map appeared in the white things. It turned out that the map had been working all along.

The reason we get all this light blue background is because the engineers at the back end, they can’t get real data upstream, so they write the latitude and longitude as (0,0), which goes straight to the Atlantic ocean.



With zero latitude and longitude, it is an area of the Atlantic Ocean near the Gulf of Guinea in Africa. Is this the rhythm of delivery to the Atlantic? When I checked the time, it was already 2:30 in the morning, and the docking buddy had already run away.

I guess tomorrow, the front end engineer, he’s gonna have to bring a knife to work.

Bad bugs don’t stop there…



Once, many users reported to a notebook manufacturer that the computer would inexplicably crash while playing Li Na’s Tibet Plateau. Tests have found that when the record sings “That is qinghai-Tibet High…” “, the hard drive resonates, and the read/write head cannot read the data, causing the crash.

To find this bug, the programmer listened to Qinghai-Tibet Plateau for a month.

Some programmer, when writing a very simple function, there is a very strange bug, the left side of the screen text display is not complete, very depressed, I did not move anything.



In order to solve this problem, various methods have been tried, including XML to control margins, Java to control margins, and the results are quite confusing.

Until, on a whim, the programmer ripped off the phone’s protective cover…



It seems that when finding a bug, it is better to think about the problem with normal people’s thinking first…


The original article was published on August 17, 2018

This article is written by W3CSchool

This article is from the cloud community partner W3C Programming Tutorial. For more information, follow the W3C Programming Tutorial.