Five ways to become a better programmer

Source: Internet
Author: User

Author: http://coolshell.cn/articles/2606.html Chen Hao

For me, a good programmer should be trying to achieve as high quality as possible in line with the demand of code implementation. Some people may think that good programmers are programmers who know many programming languages and are very good at technology. Yes, this is true in some cases. But in the final analysis, no matter what kind of technology you use, what kind of language, all programs are written out, their functions must meet the needs and be as robust and error-free as possible and of high quality. We can imagine that if a common programmer has enough time for testing, it can also ensure the quality of his code. Therefore, there is a view that code with high quality only requires enough time for testing. This is understandable for result-oriented commercial software development (we can see that the energy and time spent by the car manufacturers on car testing can be understood).

However, it is obvious that all developed projects are developed under Imperfect conditions. Generally, almost all projects are maximizing the development speed of Programmer software. Moreover, in many cases, we seem to be not very concerned about deep testing and stress testing. Therefore, we always pray and expect that the code that comes out of work can work normally, especially when it comes online, this idealistic value is more intense. In fact, the development speed is not in conflict with the quality of software products.Good programmers must be skilled programmers, but those who can ensure the quality and efficiency of software in an imperfect working environment.. Below are the ideas that five programmers can make better in this imperfect situation (they have nothing to do with language and technology, but they are just a kind of work behavior, can communicate with all industries), these five ideas may make you such a good programmer.

  • Find different points of view:Programmers do not seem to like people with technical differences. They especially like to argue about their respective technical points. However, they ignore the value of different points of view. Everything is good or bad. We should learn to learn and balance in different points of view. In this way, we will learn more about programming and technology. Do you always ask yourself and others before doing things? After the event, I asked myself if I could improve my skills? Try to find different ideas or methods. Programmers should frequently access the Internet and often discuss different implementation methods and technical points with colleagues so that they can learn from each other. However, in actual work, I found that programmers do not like to consult with each other, because the person who asks questions is afraid that others will look down on him, and the person who asks questions is always downgrading the other's abilities first ...... (See ten actions that turn you into a bad programmer.) It doesn't matter if you have such a cultural atmosphere. People on the Internet do not know anyone, so they can ask silly questions. Haha. In a word, you must understand that if there is only one point of view in some things, you must doubt it. There is no comparison between the points of view and the technical solution, and there is no such situation, you cannot know whether there are any better things. There is not only one sound of true harmony. The true harmony lies in learning from each other from different points of view (see ten good programming ideas). Otherwise, you will never accept new ideas, and you will not be able to make progress or grow.

  • Never trust your own code: Be sure to highly doubt your code at any time. In many cases, errors are always caused by yourself. Therefore, when a problem occurs, you must learn to review all the doubts in the Code. Do not think that a piece of code is very simple, but you can skip it. Facts have proved that many carelessness is the ship turning in the gutter, which is a very low-level mistake. In the process of checking the error, do not draw conclusions too early, do not change around (see "various popular programming styles"), stop, think about where the code will be a major suspect, then, check the code, compile the logic of the Program (see the Rubber Duck program debugging method), debug and verify whether the logic and variables of the program are correct at runtime. Most of the time, for those difficult problems, the final solution is always because we start to carefully look back at all the code. Only by keeping a high degree of doubt on our own code will we think about how to make it run better and more stable, and make more effort in unit testing, in this way, we can save more time in that busy environment. Believe me, fix it in the integration test
    Bugs are much more costly than fixing bugs in unit tests. A simple example is memory leak. Programmers need to be aware of their own programs, so that they will become more and more mature, and their own capabilities will become stronger and stronger.

  • Think and relax: Think twice before doing things. In this way, you will not be confused and confused. Once things get messy, your mood will change, and things will become messy. Finally, you have to rewrite it. There are too many such things. In addition, you must learn to enjoy and relax at work. I am not asking you to chat about QQ at work. I just said, sometimes, your mind is too tight and the pressure is too high, your work is worse, which in turn leads to a new round of anxiety and tension. I personally think,Thinking and relaxation can be perfectly unifiedThinking is actually a kind of relaxation. Stop, take a break, look back and see the path you 've been walking through, drink your saliva, and climb high. Are you right when you look at the past? What is the overall situation? To sum up, let's see how the road goes. This will make you better and faster. Good programmers are not the kind of hard-working people. Good programmers are always those who are good at summing up success or failure, good at thinking, good at adjustment, and good at relaxation (see "ten habits of excellent programmers"). Otherwise, what I can see is that when you finish your work quickly and just sit down at home, the boss or customer will call to tell you that your program has a problem. In short, you think carefully and the action will be slow, but you can ensure the quality of your work results, but it will save you more time.

  • Learn History and keep up with the times: If you started programming ten years ago, today's language or technology will have a lot of improvements and improvements. You used to develop a function or function. Today, it has already been integrated into the language and is much better than your version. In the past, you needed 100 lines of code. Today, only one line of code is required. This kind of thing will happen in the future, so today you must learn how to keep up with the times. However, you should not give up history. Now I see many programmers use modern languages and technologies very well. They can easily keep up with the times. But don't forget that technology updates and elimination in the computer world are fierce. Therefore, you must learn history. These history are not the history of the manufacturer, but the history of the entire computer culture (see the Unix legend). Only through history can you understand the problems in history and the reasons for the emergence of new technologies. In this way, you can better understand these new technologies and the direction of tomorrow. Learning History and keeping up with the times are very important. By using new technologies and stopping for training, you can work faster and more efficiently (see 10 skills that programmers need to master in the next five years). Learning and summarizing history will help you find a direction in the chaotic world.

  • Actively promote testing activities: Only testing can prove that the software works normally. Only testing can ensure the quality of the software. No matter what the product is, it must be tested more or less. Fully tested products or modules, you will find that the quality is always so good, the testing of non-sufficient products, the quality is always so. How about the quality of German and Japanese cars? The key lies in how to test and whether the test is adequate. Therefore, in the process of developing software, if you say that your program is well written and of high quality, please come up with a real test report. Throughout the software development process, as a good programmer, you should actively promote the project team to carry out testing activities in various stages. Do not think that the technical requirement and design phases do not need to be tested. The same is true if you want to release anything. How to test technical requirements? User cases are test cases. In the whole process of software development, ensuring product quality is sometimes more important than achieving the demand, especially those products that are very important or even destiny.

The above five points of view may allow you to work better, faster, and more efficiently in an imperfect work environment, hoping to be useful to you. In addition, you are welcome to leave your point of view!

(Full text)

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.