Technical director talk about how programmers write code

Source: Internet
Author: User
To judge whether a programmer is a good programmer, mainly look at the code he writes, because the most important thing for a programmer is to write code. Even if you don't understand the intent of the code, just take a look at the code that good programmers write and the code written by poor PHP programmers can be seen basically. Good programmers write code, neat and normative, visually there is a natural beauty. Blank patchwork, annotations just right, naming and typesetting conform to uniform specifications. Poor programmers write code often appear too long functions, inconsistent naming and typesetting, too deep nesting structure, very complex expressions, ubiquitous numbers and other problems. Again to coarse reading, good programmers or poor programmers will be more confident. Good programmers write code that has a well-crafted consistency. Good programmers consistently follow a unified naming approach, such as CamelCase, and the bad Programmer's variable naming occasionally deviates from the unified specification. Good programmers have very little spelling errors in their code, and bad programmers have much more spelling mistakes. Good programmers for the same kind of action, do not momentarily use this verb, and then use that synonym, such as add/insert mixed. Good programmers use consistent shorthand rules, while poor programmers sometimes do not abbreviate or abbreviate. Good programmers will pay attention to the names of adjectives and nouns who are in front of who in the post, while poor programmers have no rules, sometimes before and after. Good programmers seldom write large sections of repetitive code, but poor programmers often do not have the repetitive code, and they have difficulty in extracting duplicate code from a unified concept for reuse. Good programmers for external APIs will pay attention to the consistency of comments and code, poor programmers often comment on the parameter names and function definitions are inconsistent. Good programmers rarely leave the commented out or the spam code in # if 0, they are determined, the code is useful, no, no, poor programmers are different, they often don't know if a piece of code really needs, they lack the habit of keeping the code neat, so they let the garbage code keep. As above, even if you do not understand his language, but do not care about the logic of the program, good programmers or poor programmers can do sorta judgment. The quality of the program almost always depends on whether they are beautiful, not beautiful and good program, in addition to the C + + STL source code, I have never seen (if you look carefully, STL source is not beautiful, but still meet the consistency principle proposed here). and nice and beautiful code is everywhere, such as Linux kernel,innodb,jdk,junit and so on. If you read it carefully, you will be more accurate. Good programmers write code that seems like a natural, simple and straightforward. Functions are usually shorter, and the name of the function accurately reflects the work to be done by the function. Logic is simple and natural, let you read the heartfelt out Ah, it should be such a sigh, and poor programmer's code often let you emit how is this? What are you doing here? The question. GoodProgrammers will be in a pinch to make a finishing touch of the comments, poor programmers either did not comment, or comments are just code duplication, pure nonsense, worse is the comment is wrong, is misleading. A good programmer is not necessarily a language lawyer, that is, the kind of guy who knows all the details of a language, and uses it everywhere in programming. Good programmers do not often dazzle, and in the code to elaborate some ingenious pieces, they occasionally, but most of the time is always in plain language to express. From the code can also be seen a programmer's team spirit of collaboration. Note that team-working programmers will write code in strict accordance with team rules, while programmers with inconsistent style and team discipline are likely to lack team spirit. Note that the team-working programmer will notice important instructions to the external interface of the module, such as preconditions, post conditions, whether the parameter is NULL, etc., and the programmer who is not aware of the teamwork is lazy to deal with these details. Good programmers and poor programmers have a huge difference in productivity, the longer the project cycle, the more complex the project, the higher the quality requirements, the greater the value of a good programmer. Good programmers and poor programmers, management costs are very different, good programmers only need to work with him to determine the design, code can not see, poor programmer's code often need to go through multiple review, and still may not achieve the desired quality. To become a good programmer, first of all to establish to become a good programmer's ambition, and then practice, forever, will be more and more good, these people are not afraid of the old. No ambition will ever become a good programmer, and these people will become useless if they don't become managers before they are old. Passing a two-hour written test and a half-hour interview is not enough for a programmer to judge. Through written and interview, you can judge whether a programmer has the basic knowledge of algorithm and data structure, can judge whether he has mastered the characteristics of the programming language, can judge whether he is concerned about the technology, but to know if he can really do a good job, not writing code is not enough. Those who appear to be passionate about technology are not necessarily good programmers. These people may be happy to do something new, but the subsequent coding, testing, commissioning, and copywriting work may be annoying. They may come up with good ideas, but they are often not able to finish them. Companies don't need many of these people. So the hiring approach needs to be improved. Recruitment is the most important, because it is difficult to go out, even if the trial. Positive conditions written in black and white is very clear, as long as qualified can be positive, to meet the eligibility is not very difficult. This year the department into a lot of new people, not everyone is very good, but it is also qualified, nature should be positive. The way to improve recruitment is to let him write the program, can give two questions, together let him write the program, together let him reconstruct an existing longer program, completed within one day. If you can test him for half a month, then refactoring is not necessary, but the time of day is too short, through refactoring can examine reading and understand the code, and through the reconstruction of the ability of decay as magic. Those who don't want to write someone else's generationCode, not willing to accept other people's codes, often to repeat the person is not ideal. This year, two people have adopted a similar approach. There is a very good resume, did two programming problems were rejected, a resume and interview people, through the programming test, hired. I feel more accurate than a simple test and interview. Free to receive the Lamp Brothers and original PHP tutorial CD/"Detailed PHP" Essentials Edition, details of the website customer service: Http://www.lampbrother.netPHPCMS two times development http://yun.itxdl.cn/online/phpcms /index.php?u=5 Development of HTTP://YUN.ITXDL.CN/ONLINE/WEIXIN/INDEX.PHP?U=5 Mobile Internet server-side development http://yun.itxdl.cn/online/server/ Index.php?u=5javascript Course Http://yun.itxdl.cn/online/js/index.php?u=5CTO Training Camp http://yun.itxdl.cn/online/cto/ Index.php?u=5
  • 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.