Xi Jia--Kong Yiji's C + + Edition

Source: Internet
Author: User

The pattern of Euclidean code is different from other programming modes: First, there is a constructor, and the base class defines only the form of the function, which can be derived to add different implementations at any time. Those programmers, often learned to inherit and polymorphic, then can take a project--this is a decade ago, now at least to understand the design pattern,--stand outside the counter, write some code for an egg cake to eat, if you know some multi-threaded knowledge, you can add ham sausage, or loin in egg cake, If you understand the principle of language implementation, then you can do some of the underlying code optimization, for a dish of stir fry. But these programmers, mostly at the primary level, are probably not so deep. Only the memory model can be connected to some of the underlying projects, open the debugger and profiler, and slowly sit to optimize the code.

Since I was 12 years old, I was an apprentice at the Githoverflow factory in the entrance of the village, and my teacher said, I think logically too poorly, afraid to learn not static type language, write some shell script it. Shell scripts are easy to write, but there are also many places where the syntax can be confusing. The function of string and array is very weak, the syntax of conditional judgment is also very peculiar, sometimes you need to do double escaping to special characters, then pass. In this case, writing scripts is also difficult. So after a few days, the master said I could not do it. Fortunately, the head of the feelings of the big, dismissed, then changed to a specialized test of a boring job.

I've been standing in front of the test machine all day, running the test scripts. Although nothing dereliction of duty, but always feel some monotonous, some bored. Master is a pair of fierce face, the programmer also did not sound gas, teaching people lively not, only the evening nail to the factory, can laugh a few sound, so far still remember.

The evening armor is the only programmer who stands up and manages memory manually. He used the development language syntax is bloated, the structure is messy, the code between often clip some #ifdef; a bunch of messy. h files that act as interfaces. Although the memory is managed manually, there are often wild pointers, either forgetting to initialize or not set to null after release. He wrote the code, always full screen artifice, so that people half understand not understand. Because his surname Xi, and always feel his technical number one, others will use the "a-B-butyl" The first word, for him to take off a nickname, called Xi Jia. Xi Jia one to the factory, all the programmers will look at him laugh, and some called, "Xi Jia, your code again a new bug!" He did not answer, said to the cabinet, "come to two eggs to fill the cake, a cup of soy milk." "Put the ThinkPad in place." And they shouted, "You must have leaked the memory of someone else!" "How can you be so clean and innocent ..."? "What's innocent?" he said, with his eyes wide open. The day before yesterday I saw you blow up the memory of windows and hang it. "Xi armor will rise red face, the forehead on the veins, arguing," memory not released can not calculate leakage ... No release! ...... What about the programmer, can you count the leaks? "Successive is difficult to understand words, what" new/delete paired use ", what" who applies for who release "and so on, attracted all laughter up: inside and outside the factory full of cheerful air.

Listen to people secretly talking about, Xi Jia has also read the original Dr. Cs, but finally did not go to do academic, and will not earn a living, so the more poor, get will beg. Fortunately, will write some code, they do a few games for others, change a bowl of rice to eat. Unfortunately, he has another bad problem, is a memory leak. Running in less than a few seconds, even the program with data, and collapsed. As a couple of times, no one called him to write the game. Xi Jia no law, then had to do some of the simplest outsourcing projects. But he is in our factory, the conduct is better than others, is never left the bug, although sometimes can not be resolved, temporarily recorded on the wiki, but not in January, must be repaired, from the wiki to delete the name of Xi Jia.

Xi Armor Write half page code, red face gradually back to the original, others then asked, "Xi Jia, you really can write code?" "Xi Jia looked at the people who asked him, showing disdain irrefutable air." They went on to say, "How do you even have half a line of code that doesn't contribute to the Linux kernel?" "Xi Jia immediately showed dejection uneasy appearance, the face of a layer of gray, Mouth said some words; this time is all" dog excrement Linus ", some do not understand. At this time, the crowd also laughter up: inside and outside the store is full of cheerful air.

In these times, I can echo the smile, the master is never to blame. And the master met the Xi Jia, also often ask him, to arouse laughter. Xi Jia himself knew not to talk with them, they had to speak to the children. Once said to me, "Have you ever learned to program?" "I'll have a little bit of a head. He said, "learned programming, ... I will test you a test. const INT * and int const *, what's the difference? "I suppose, begging the same person, also test me?" Then went back to the face, no longer listen. Xi Jia A A long time, very earnestly said, "Do not know?" ...... I'll teach you, remember! These grammars should be remembered. In the future as a programmer, write code to use. "I thought to myself that I was still a long way from the programmer, and that our master never used bare hands, and laughed, and impatiently, and said," Who wants you to teach, two no difference, is a pointer to a constant. If you want to use the pointer constant, write int * Const. "The evening armor shows extremely happy appearance, will hand the broken mouse to knock at the computer table, nods to say," Yes yes! There are four ways to use const, you know? The more impatient I was, the more I tried to walk away. Xi Jia just a new empty file in Visual Studio, want to write code in it, see I was not enthusiastic, then sighed, and showed a very sorry look.

A few time, the neighbor children heard laughter, also gendarmes, surrounded by the XI armor. He wrote one of them a Hello world. The children watched, still not scattered, the eyes are looking at the screen. Xi Jia a panic, stretched out his fingers will screen, bending down and said, "error, the compiler reported error." "Straight up and looked at the screen, and shook his head," said the error error! Is it a pity? Error also. So the group of children were separated in laughter.

Xi Jia is such a happy person, but without him, others have so.

  
One day, about two or three days before the programmer's Day, the master is slowly release code, open the wiki, suddenly said, "Xi Jia Jia Long did not come." There are 19 bugs that haven't been fixed yet! "I also feel that he did not come for a long time. A drinking man said, "How did he come?" ...... He has a discount on his leg. "The master said," Oh! "He's still doing the memory." This time, it was his own faint, unexpectedly collapsed gFw memory. The memory of his house, got it? "What then?" "How about that?" First go to tea, then hit, hit the most nights, and then discount the leg. "And then what?" "Then the leg was discounted." "How about a discount?" "How?" ...... Who knows? Xu was dead. "The master also no longer asked, still slowly do his release."

After the programmer's Day, functional programming is a day more popular than a day to see that even Java is starting to support lambda expressions; I have to do tests all day, and I need to know what closures are. For the next half day, without a project to test, I was sitting with my eyes closed. All of a sudden I heard a voice, "Let's have an egg-pie." "The sound is very low, but it is very familiar. There was no one to look at. Standing up and looking out, the evening armor was sitting on the threshold under the counter. His face was black and thin, and he had no appearance; with a broken ThinkPad, with two legs, and a computer bag under it, with a rope on his shoulder; and I said, "Let's have an egg-pie." The master also stretched out his head and said, "Xi Jia Jia?" You still have 19 bugs that haven't been repaired! "Xi Jia Jia is very dejection," replied the. Next repair. This is a live pass, and eggs are better. "The master is still the same as usual, smiled and said to him," Xi Jia, you have a memory leak! But he did not quite discern this time, and said, "Don't tease!" "" Tease? " How do you break a leg if you don't leak? "The evening armor whispered," Fall, Fall, Fall ... "His wink, much like the pleading master, don't mention it. At this time has gathered several people, then and the master all laughed. I fry the eggs and pour the cakes, take them out, and put them on the threshold. He opened the computer and began to write code, and saw that he was full of mud, so he came with this hand. In a few minutes, he submitted the code, passed the test and review, and then in the laughter of others, sitting with this hand slowly walk.

Since then, I have not seen the evening armor for a long time. When the Rust 1.0 was released, the master opened the wiki and said, "There are 19 bugs in the Evening armor!" "By the time Golang 2.0 was released, he said," There are 19 bugs in the evening armor! "When the Scala 3.0 was released, it didn't say, and then the rust evolved a version and didn't see him.

I have not seen it now--about evening armor is indeed dead.

Written in the summer of 2015

Xi Jia--Kong Yiji's C + + Edition

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.