Chapter 4: Programming is an elegant art The beautiful girl, who had just entered society and was still doing internship, fell into confusion in life for the first time. When Qi Mengmeng came to her senses, she found that her master's personal belongings had not been taken away. Forget it. Since the bug can’t be solved in a short time, I might as well help my master clean it up. I’ll find time to bring it to him on the weekend. I’ll also bring along the problems I encountered at work and have an excuse to meet my master. It’s like killing three birds with one stone! Qi Mengmeng thought happily. Chen Mo didn't have many personal belongings, just a brand new laptop, a cup for drinking water and a few technical books. Just when Qi Mengmeng was gathering her strength, she heard familiar footsteps behind her. Turning back, I saw Chen Mo panting as if he had just run a marathon. Qi Mengmeng's little face was full of surprise. "Master, you didn't leave." Chen Mo put the bundle of red cloth he was holding on his newly renovated workstation, took the tissue handed to him by his apprentice and wiped the sweat from his forehead. I asked casually, "Has that old bastard been here?"
Qi Mengmeng immediately understood and shook her head. Chen Mo originally thought that Wang Defa would ask the company security to forcibly clear him out, but he didn't expect that there was no movement for such a long time. After thinking about it, he began to understand. I guess he is worried that forced liquidation will cause more negative impacts, especially during the sensitive period when customers are about to visit. It seems that this old guy intends to handle this matter coldly? It's good that Wang Defa is not that stupid. Otherwise, in the end, the barefoot ones are not afraid of those who wear shoes, and the biggest loss will be the company's interests. As long as the company's interests are involved, this old guy will back down immediately. Thinking of this, Chen Mo walked to the wall, took down all the PUA slogans hanging on the wall, and threw them into the trash can nearby. Getting ready to replace the newly printed banner I just went out with. Qi Mengmeng's EQ came online, and she quickly trotted over, "Master, let me help you." Soon, all the banners were replaced. Looking at the neatly written slogans on the wall, Chen Mo patted the dust off his hands, looking very satisfied. Colleagues nearby gathered their attention and looked at the slogan. Everyone had a light in their eyes and talked about it. If it weren't for the fear of alarming the source of all evil, they would have wanted to applaud and cheer. But even so, the commotion in the technical department still alarmed the HR manager who had never been involved in HR affairs. The latter came over, facing the crowd with his back to the wall and his hands on his hips, and said in a very imposing manner, "Pay attention to the company's order. You can discuss and solve problems, but don't discuss things that are not related to work. The customer will be here soon, and you are chattering away for no reason." After taking a quick look around and seeing the employees who quickly quieted down and Chen Mo who was unusually quiet at his workstation, the HR manager nodded with satisfaction. He then pointed to a few employees whose workstations were more messy and asked them to move their workstations to the innermost positions. Finally, he pointed at Chen Mo and said, "Chen Mo, come with me and complete the resignation procedures." Thinking about the strange expressions on those people's faces, I vaguely felt that something was not right. After thinking for a while, I still had no clue, so I gave up and hurried to deal with this troublemaker at hand. After the HR manager took Chen Mo away, the pleasant atmosphere returned to the scene. A few minutes later, Chen Mo came back after finishing the formalities and saw Qi Mengmeng staring at him with her big eyes, blinking and not saying a word. Seeing this familiar scene, Chen Mo understood it immediately and said with a smile, "Another difficult and complicated case?" nod. "I come?"
Nod*2. "Get off." "Okay~" Qi Mengmeng, who had been waiting for this sentence, smiled happily and adjusted the angle and height of her chair like a servile person, wanting her master to sit more comfortably. She also tried to save face by saying, "Master, this time it's not that I didn't try hard, but the enemy is too strong. I tried my best and used all the ideas you taught me before, but it still doesn't work. It seems that this problematic code is incompatible with my horoscope. It's a conflict with my destiny." Chen Mo lightly tapped Qi Mengmeng's head, and the latter covered his head with his hands and calmed down. "You are the most stubborn among all the subordinates in the body. When there is a problem, analyze it and solve it. Don't have any subjective emotions in our line of work. You have to remember: just like mathematics, programs will not lie! Besides, I’m a member of the group, so being cute doesn’t work on me!” Chen Mo took over the magpie's nest and looked at the many small dolls and figures placed on the workstation. He recognized the Big Three of Fire, Death and Sea, as well as a Super Saiyan 2 Goku. They were all memories of his youth. The other anime figures should have been released later and were in his blind spot. Looking at the pink and white mechanical keyboard in his hand, it has a blue switch. Even he is still using the broken keyboard provided by the company. I can't help but feel speechless. It's impossible for me to have the energy to write good code. Wang Defa's catchphrase is to treat the company as home. It seems that this girl is mainly a person who listens to advice. Then Chen Mo looked at the code on the monitor. At a glance, I can see the cause of the anomaly that Qi Mengmeng is referring to. The solution is very simple, just modify the logical judgment. But thinking that as a master, this might be the last time I teach her. Chen Mo first spent a few minutes quickly scanning through all the codes that Qi Mengmeng had written during this period, and frowned. It’s not that the problem is too tricky, but saying that the code written by Qi Mengmeng is a mess is just praising her and she can’t get any benefits. However, Chen Mo did not discourage the other party's enthusiasm. He entered the working state with a blank expression and focused look, giving people a sense of alienation, as if he was a machine without emotions. Chen Mo analyzed and commented on these codes. "The logic here is wrong! It is inconsistent with the requirements, and an additional if judgment is needed" "This function does not have a complete check at the beginning. If the user enters any other characters, an error message will be displayed." "And here, how can you write like this? These are all basic grammar knowledge, how can you make a mistake?" "In general, your logic is confusing, you hit the nail on the head here and there, it's all patched up, a mess, difficult to maintain, and you still haven't gotten started after two months of hard work!" Qi Mengmeng, who had been lowering her head, rubbed her index fingers together and explained, "One of the codes is the one you wrote the day before yesterday, have you forgotten it?" Wow? So there are some of my code in this pile? Chen Mo, who was a little hesitant at first, just selected all. I pressed the delete key decisively. Seeing this scene, Qi Mengmeng's pupils dilated and she couldn't help but scream out, "Oh my god!" He stretched out his hand to search the enemy in the air, as if trying to save something. Chen Mo glared at her angrily, "What's there to linger on? The foundation is too poor, there are too many problems, and it's too troublesome to change them one by one. It's better to rewrite it. Instead of feeling sorry for your broken code, you might as well take a good look at it this time and learn it well! It will be worth my teaching if you can put it into practice." "Yeah." The matter was done, Qi Mengmeng could only accept the reality and began to concentrate. She swore that she had never been as serious before the college entrance examination as she is now. "I told you before that you need to have an object-oriented mindset when writing code. Everything is an object." "We need to abstract some common codes here to avoid repetitive work, which is just like moving bricks on a construction site. For example, you can write it like this." Qi Mengmeng watched with fiery eyes as line after line of code appeared on the screen, flowing smoothly. The master's fingers danced on the keyboard like butterflies flying through flowers. The ups and downs of the keyboard tapping seemed to imply some mysterious rules, which was pleasing to the eye. At this moment, the master who seemed a little handsome seemed extremely cool in her eyes.
"Programming is not only about realizing functions, but also about elegant art. The original hundreds of lines of code are now only more than 20 lines. Let's run it and give it a try." No matter how awesome the words are, they have to be put into practice to prove their true colors. Chen Mo prepared to restart the execution. Looking at the second confirmation window that popped up on the screen, as if he was playing Audition, Chen Mo moved his shoulder with his elbow, his elbow with his wrist, and his wrist with his hand, and finally lashed at the Enter key like a whip. The crisp sound of "PIA" injects into the soul! Collect and you won’t get lost, read and you can get rich~~~ (End of this chapter)