These senior programmer programming tips, teach you to write high-quality code!

In today's age, everyone is trying to upgrade their skills. If we talk about Web applications, think of Spring, Play and Struts and other frameworks that can help us to build software with the scalability and manageability. Through them, you basically do not need to write too much code you can build an application.

But the fact is not difficult to write code, write code quality is difficult. As a developer, you want to reach customers expect, Bug write any code does not appear, but this is highly unlikely. How to determine whether a piece of code quality, a good rule of thumb is: The code that lets anyone can read it like reading the same phrase, here to share with 10 senior programmer programming tips, teach you to write high quality code!

1, reconstruction of thinking

Do not come on to start writing code, to master as much of the reconstruction method to reconstruct way of thinking, grasp the reconstruction is not necessarily to reconstruct the original code, but wanted to make himself better how to write before they put pen .

2, needs to find out before you start

After seeing the demand, certainly there will be more or less problem on some of the issues, or errors in understanding, or function to achieve, then, must be the exchange of clear, otherwise, there will be more follow-up questions.

3, the document also write

Many people may feel that no one document, write do not write it does not matter. However, no one document, or write.

Most of the time is not the role of the document used to communicate, but to do the record, most of the demand or through verbal communication, but do not write the document record, it is easy to follow wrangling.

4, must write code comments

You must write a comment, if you do not write notes, over time, come back to even you can not read. Furthermore, a project can not be responsible to you a man, comments can let other colleagues understand your code,

5, and communication needs change

Do not expect demand will be steady, demand for products based on business needs constant adjustment and optimization, demand is normal to change things, do not always complain, good attitude adjustment is the last word.

6, handle the relationship between business and

Whether it is technology or business, do not think above the other, it should be a complementary relationship.

Not for the company to do business technology services, is worthless, the company makes money is the last word. Do not tangle the company has been changing needs, changing business.

7, do not leave things to chance

If somewhere you will feel a bug, then, necessarily bug. Do not leave things to chance, must bring their own bug will feel a good place optimization, leaving troubles.

8, their first test times

Do not throw the finish on the tester to measure, be sure to test yourself first few times, your writing and your own more familiar and easier to find the problem. By what they hand to ensure quality.

9, as far as possible to solve the problem yourself

Encounter problems, first try to resolve their own, it can not be resolved then help others. In the workplace, no one is obligated for your backside, your boss and co-workers have their own things to resolve. However, if the problem is urgent or serious, must be resolved quickly for help, do not be afraid to be scolded, such as when the real problem may be more serious consequences.

10, the new technology with caution

I do not deny that the new technology is a good thing, but when in use, not hundred percent sure on self-assertion, mostly seek death. If it is really a problem that he can not solve, irreparable damage will occur.

So, after receiving the items, do not rush hands start writing code, first thinking, when demand gains, be aware of the work of each section, and then start writing, more efficient, and the chance of error also lower.

Guess you like

Origin blog.51cto.com/14489558/2447720