Internet era: How to become a good programmer?

Source: Internet
Author: User

650) this.width=650; "src=" Http://img.mp.itc.cn/upload/20160629/15f29cfdf8434dfdbcc43cad365fa43b_th.jpg "style=" border:0px;margin:0px;padding:0px;font-size:0px; "/>

How to become a good programmer, this question I have asked myself, unfortunately I do not good enough, often so ask their own words, will enhance your development process thinking, while nothing can also be asked around the programmer's colleagues, I believe you will cause some interesting discussion, But I personally think that mastering the following five skills is very important, look at it, for us all become good programmers.

  1, problem decomposition

Programming is largely about solving problems, but before writing code, programmers need to figure out how to solve these problems. A good programmer tries to split the problems and then part of it to develop, until each part can be easily solved. But this is not enough, a good programmer will invent a working pattern, use the existing standardized logic to develop, easy to implement and test. Some very complex programs, the complex part of the reason is that code implementation does not solve the problem perfectly, and the code is difficult to understand.

When confronted with the problem modeling, once interviewed the excellent developer: "Very few programs can not be modified, but if you look at a piece of code, it often seems very complex, many people feel that they often do not have a way of thinking, and I will roll up the sleeves to try to repair it, slowly actually these are not difficult, and very easy." ”

  2, Situational Analysis

Good developers have the ability to consider many different scenarios. This applies both to the logic in the program, as well as to internal and external events that may occur. Considering the logic of the different paths, they would ask the question: What if this argument is zero? What if these conditions are true? Is this a thread-safe approach? Discovering what types of events the software needs to handle, they ask the question: What if this queue gets full? If you do not respond to this request? If another server restarts, does this server restart?

A good programmer will ask himself, "How can this end?" "It means they also want to test their ability, in contrast, most inexperienced programmers only consider themselves, can temporarily solve the problem, of course, most of the unavoidable accidents happen, they have a way to solve."

  3, as shown in the name

Programming is largely by naming things: classes, methods, and variables. If done well, the program becomes largely self-documenting, which means that the function of the program is very clear in the execution of the source code. One of the functions of self-documenting code is that it naturally leads to many minor errors, rather than a few large functional flaws, because these excellent code will exist in a lot of places.

It's much more difficult to come up with a good name. I like the phrase: "There are only two difficult things in computer science: Cache invalidation and naming." "Part naming is very difficult because it needs to be clear in mind what each name stands for." Sometimes this is unclear, but it will manifest as development progresses. Therefore, renaming a name is just as important. ”

The naming also includes the concepts proposed, and what these concepts should be called. By thinking through it, it is easier to write a program that is used consistently by a clearly named concept.

  4, the consistency shown

Perhaps the biggest challenge in programming is the complexity of management. Consistency is a battle of complexity. It reduces some of the complexity, allowing us to see patterns and infer how to name, use and manipulate. And consistency, we don't have to use our brains to remember anomalies and random changes. Instead, we can focus on the important complexities, not the occasional complexities.

Consistency is very important. It applies to variable names and groupings, naming methods, partitioning into modules, directory structure, GUI, error handling, logging, documentation, etc. For example, if some variables are related and appear together (in a declaration, a method call, or a column in a database) then always use the same order. Then it becomes easier to see if lost, or if they have been confused. For an operation, if it is calleddelete in one place, don't call it delete in another place-stick to the same name. Steve McConnell also has some good suggestions for using exact opposites in your code. For example, start/end antagonism, start/stop. Do not mix names from different pairs (for example using Start/stop) in the process opposite.

Contradictions can be introduced when modifying a program. Sloppy programmers often don't notice if they add conformance to existing code. Good programmers are right in making sure that seemingly heartless little details, they know how important consistency is the complexity of the overall confrontation.

  5, Learning

As a software developer, you need to keep learning. Before you add a new feature, you have to understand what it should do. Before you add code to an existing project, usually you need to learn what the existing code is, in order to accommodate the new functionality properly. You also have to understand the surrounding system for the right interface. Therefore, the ability to learn quickly makes you more effective as a developer.

In addition, as the speed of development in the field of software engineering is so high, there is a steady flow of new languages, tools, techniques and frameworks to understand. You can think of it as good or bad. Fred Brooks lists one of the pleasures of learning to turn skills into crafts, which I agree. Learning new things is exciting in itself. This also means that life as a developer will not be boring.

Conclusion

All of the above skills are generic, no one specific to any language, framework or technology. If you have, you can quickly learn a new language or tool and write a good software environment. In addition, because they are universal in nature, because the language will never perish, these are some of my advice on how to become a good programmer.

This article is from the "first to a cup of Java press yajing" blog, please be sure to keep this source http://maybeone.blog.51cto.com/11734094/1794171

Internet era: How to become a good programmer?

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.