Chapter Eighty-Six: A Programmer with a Tendon
On this day, Qi Binxuan was preparing for class in the store, and a takeaway came to deliver food to tea customers. Qi Binxuan glanced up, and then continued to prepare for class, suddenly, he felt that the delivery person was very familiar, and then took a closer look, it turned out to be his own hair Xiao, Sun Mu, nicknamed Sun Mutou.
Qi Bin shouted: "Sun Mutou." The man turned his head and seemed to recognize Qi Binxuan, smiled awkwardly, and said, "It turned out to be Binxuan, didn't you go as a soldier? What are you doing here?" ”
"I'm out of the army, help my dad look after the store. I heard you're a programmer, how did you deliver food?"
"Hey, it's hard to put into words. Sun Mutou sighed, with deep helplessness.
Qi Binxuan asked him if he was free, he hadn't seen him for a long time, so he would sit down and talk when he was free.
Sun Mu looked at his phone and said, "The list is all gone, okay, long time no see, let's talk." ”
Sun Mu sat down, took the tea handed over by Qi Binxuan and asked, "What's wrong with your leg?"
"I was injured when I was in the army, but it didn't get in the way, I basically recovered, and I had no problem walking on crutches. Then Qi Binxuan asked half-jokingly: "Do you make money by sending foreign ** programmers now, why did you change your career?" ”
Sun Mu began to pour bitter water: "Hey, it's not easy to work." I started working in a private company, and although I worked overtime, I didn't do much. That's what we're doing, but it's not like to be paid for three months in a row. So in a fit of rage, a few of us joined forces to sue the boss. Although Dali Temple won, the boss also fired us. ”
Isn't this nonsense, you sued the boss, it's strange to be able to use you again.
Qi Binxuan asked again: "Then you can also go to other places to do it, why do you change careers?"
Sun Mu continued: "After that, I went to a small software company that developed dongles. I was involved in the development of a drainage software for municipal roads. During my work, I noticed a bug with the software. By the way, do you know anything about the program?"
Qi Binxuan looked up at the sky with slanted eyes, thought for a few seconds, and then said, "I don't know much. I've heard that programs are generally rigid and strictly follow code rules. For example, a programmer's wife told him, "Go to the street and buy a few pounds of apples, and if you see a watermelon, buy one." Then the programmer came back with only one apple. Because according to the code regulations, 'seeing watermelon' is equivalent to the conditional code, and 'buying one' becomes the execution code that changes 'buying a few catties of fruit', so it should be 'buying an apple'. ”
Sun Mu laughed knowingly after hearing this, and the embarrassment of being recognized by acquaintances at the beginning gradually faded, and then said: "This is an old joke." But this paragraph has a fatal bug, well, that is, a flaw. ”
"Haha, I can still understand this. But what's the flaw?"
"This is what the programmer's wife told him, how is this possible? How can a programmer have a wife?"
Qi Binxuan also laughed: "You still like to laugh at yourself so much." ”
"It's not self-deprecation, it's self-deprecation. Sun Mu also said with a smile: "Programmers are the most favorite in all industries to hack themselves, and I was the first local tyrant programmer in the Great Song Dynasty to hack myself." I remember a very famous newspaper reported a special feature called "Dick Silk: The Birth of a Word". Then the first local tyrant Shi Da programmer immediately preemptively registered the trademark of the dick silk online game, which was a portrait of him, and next to it was written'I speak for the dick'. ”
"Haha, interesting. But you're a bit off topic, what's wrong with the drainage software you just mentioned?"
"Even, it's a bit related to this, it's not off-topic. Sun Mu smiled, and then explained: "From the two or three jokes just now, you should be able to see some characteristics of our programmers, that is, being too humble. Do you know what it means to be too modest? It's too modest. It means that programmers are proud of their own technology and humble about everything else. But this humility is not the point, the point is the pride in one's own technology. The professional field is my territory!"
When Sun Mu said this, he took a sip of tea with a sense of arrogance, and then said: "When I was researching the drainage software, I found a bug that would cause the elevation control of the drainage pipeline to be unreasonable. Do you know the drainage line? It's the drainage system of the urban pipe network. There are three prerequisites for this drain arrangement. First, it is necessary to follow the objective law that the water flow is from high to low, that is, the pipeline inlet is high and the outlet is low; the second is to be greater than a certain slope to ensure the smooth flow of water and a certain flow rate; third, the pipeline and road surface should have a certain amount of covering soil, that is, the thickness of the covering soil, to ensure that the pipeline will not be damaged by passing vehicles. Well, do you know what I'm talking about?"
Sun Mu asked again, after all, he didn't understand the premise of these knowledge points, and he definitely didn't understand the explanation later, so it didn't mean anything.
"Understand, the basic logical premise. Besides, we are civil engineering majors, and we are half an old business. ”
"Okay, I'll explain it to you next. First of all, according to the second requirement, it is necessary to ensure that the minimum slope of the pipeline is greater than 1/1,000, that is, the minimum elevation of 1,000 meters should be lowered by 1 meter; according to the third requirement, it is necessary to ensure that the soil cover, that is, the soil layer must be greater than 60 centimeters. Therefore, when these two conditions are combined, the code of the software stipulates that when the slope of the road is greater than one thousandth, the slope of the pipeline is equal to the slope of the road; when the slope of the road is less than one thousandth, or even the reverse slope, the reverse slope is the road with the slope going up, and at this time, the slope of the pipeline is taken as one thousandth. Do you feel that there is something wrong with this rule?"
Qi Binxuan thought for a while and said, "There shouldn't be anything wrong, right?"
Sun Mu said solemnly: "No, the problem is big." The preparation process is rigorous, must take into account a variety of situations, and needs to be modified and corrected in conjunction with the feedback from the operation. There are many practical situations that need to be considered in the layout of drainage pipelines, how can we set them up according to these two items alone? For example, I have found an unreasonable situation. You see, assuming that the drainage pipeline is arranged from the beginning to the end point, the total length of two kilometers is divided into two sections, one section is one kilometer. At the beginning of the 1 kilometer, the reverse slope is set, and the road rises 1 meter. At this time, the pipeline is required to be calculated according to the minimum slope of one meter, that is, the starting point of the pipeline is covered with 60 centimeters, and the soil is covered at 1 kilometer by 1.6 meters. Right?"
Qi Binxuan recalled the general figure in his mind, which is approximately two lines greater than the sign, the upper one is the road, and the lower one is the drainage pipe, and then compared the requirements and said, "That's right." ”
"Okay, then from one kilometer to two kilometers, the slope of the road becomes a drop of two meters, which is greater than the minimum slope, so according to the code, the slope of the pipeline is equal to the slope of the road, that is, one kilometer drops two meters, this is no problem, right?"
Qi Binxuan had two parallel lines in his mind, the direction was down to the right, and then returned: "It should be no problem, right?"
Sun Mutou smiled at this time and said, "No, there is a problem. Although the rules of the code are correct, the three prerequisites for the layout of the drain pipe can also be met. However, this is not practical. You see, at the beginning, the soil cover was 0.6 meters, the middle section became 2.6 meters, and the second half was 2.6 meters because the slope of the pipeline and the road were the same. Right?"
"That's right. ”
"Okay, if I change the slope of the pipeline to one thousandth in the second half, so that one kilometer will drop one meter, and the combined road will be one thousand meters down two meters, and the end of the road will be covered with 1.6 meters. It still meets the three prerequisites of drain pipe arrangement. So, that code is buggy, it's flawed. ”
"Wait. Qi Bin stopped it, thought about it, took out a piece of paper and scratched it a few times, and then said, "Well, you're right, this situation does exist." But that only means that your situation is a better choice. You can't say that the original code is flawed, right?"
"No, there's a big difference. Sun Mu then explained: "You see, the covering soil at the end is one meter more, which means that the pipeline layout is one meter deeper. You can understand this, right? And then, it costs a lot of work, money, and more investment. A kilometer can't be revealed, but the urban pipe network can be more than a kilometer, and the layout after a kilometer has to be accumulated plus the depth of one meter, which is an astronomical waste. ”
"Hiss-" Qi Binxuan then understood what the problem was: "Sure enough, a bug can lose so much money." ”
Sun Mu sighed: "Yes, but not only that, wasting money is one aspect, and it may lead to the failure of the pipeline and the failure of the plan." ”
"That's not it, right?" Qi Binxuan asked suspiciously: "According to the original code, isn't it possible to drain water normally?"
Sun Mu said: "Then it should be considered in combination with the water outlet." The outlet is usually set up in the river, so that the rainwater flows down the river. However, the river is very high. Let's say it's three meters lower than the road surface, but according to that code, the outlet is five meters lower, so how does it flow? So he doesn't make sense. ”
"I understand that when I say that. It seems that the flaw you found is very important. If you put it forward, you will definitely be able to get the attention of the leadership. ”
Sun Mu drooped his head at this time and said, "No, I was fired." ”
"What?" Qi Binxuan asked, "Why?"
"I told the team leader at the time, and the team leader said that the code was logical and fine. I argued with him and explained the drawing, but I couldn't convince him. In the end, he was also anxious, saying that I was not good at technology, and I was still tenacious, and did not accept the correct advice of the leader, and then reported to my superiors and fired me. ”
"How is this so?" Qi Binxuan wondered: "It's unreasonable." ”
Later, my colleague told me privately that the code was written by the team leader, and it was well received by the leader. I'm digging other people's foundations. Hmph, a programmer who discovers a mistake but never repents is not a real programmer. ”