What is the programmer's "quality?

Source: Internet
Author: User

In csdn saw a very interesting post (http://www.csdn.net/develop/article/28/28005.shtm), which said the same function, the programmers of China and Japan write code day difference:

Japan:
Dim griditemindex as integer 'comment
Dim currentpageindex as integer 'comment
Dim pagesize as integer 'comment

Griditemindex = E. Item. itemindex
Currentpageindex = meisaiichiran. currentpageindex
Pagesize = meisaiichiran. pagesize

Dim updatedatarowindex as integer 'comment
Updatedatarowindex = (currentpageindex * pagesize) + griditemindex
DT. Rows (updatedatarowindex). Item (T. bindfldname) = txt

China:
DT. Rows (. currentpageindex *. pagesize + E. Item. itemindex). Item (T. bindfldname) = txt

This piece of code has been seen in the soft engineering version before. Many people think that the two sections of Code reflect the quality of programmers. One view is that the code written by the Japanese counterparts is more standardized and more readable, so they seem to be more competent. The other view is that the code written by the Chinese counterparts is more concise and less nonsense, therefore, it seems to be highly qualified.

The quality of programmers is actually something, but it is not reflected in these two pieces of code. Maybe you have a flexible mind, clear thinking, fast brain, and a keen sense of the program. Then you may prefer the code from your Chinese counterparts. Maybe you are like me, the mind is dumb, and it is easy to get confused about the problem. It takes several more temporary variables to figure out the situation. You may prefer the Japanese code. It doesn't matter, either style is acceptable. We can easily guess that the two pieces of code are two ways to implement the same function. As a project manager, I said, it doesn't matter. You can use whatever style you like. As long as you have good quality, which style does not prevent you from becoming a good programmer. Because quality is not in either of these two styles.

So where is the quality? This is exactly beyond the two pieces of code. For the function with this code, what kind of function name do you give it? Can this name help others understand its role at a glance? Is there a unit test for this function? Can function functions, errors, and boundary values be reflected in unit tests? This is the quality of programmers. As long as you give each function a name that can be clearly understood, as long as each function has a complete unit test, you have the most basic qualities of programmers. As for the code in this function, how do you like to implement it? Maybe I should add the "refactoring" quality?

In the object-oriented theory, "interface-Oriented Programming" is the same. The quality of programmers is also reflected in interfaces. If someone else sees your implementation code, your quality as a programmer has been questioned. Let's spend more time on function names and unit tests.

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.