What is the programmer 's "quality"?

zhaozj2021-02-08  391

See a very interesting post in CBS (http://www.cbs.net/develop/Article/28/28005.shtm), the same feature, middle, day, the code is not written in the code Left place:

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 UpdatedTarowindex As Integer 'Comment UpdatedTarowIndex = (CurrentPageIndex * Pagesize) GriditeMindex Dt.Rows (UpdatedTarowIndex) .Item (T.BindfldName) = txt

China: dt.rows (.currentPageIndex * .pagesize E.Item.ItemIndex) .Item (T.BindfldName) = TXT

This code has also been seen in the soft work, and many people think that the two code reflects the quality of the programmer. A view is that the code written by Japan is more standardized, more readable, there is a more qualitative; another view is that the code of China's peers is more concise, less nonsense, there is more qualitious.

The quality of the programmer, this is a real thing, but it is not reflected in the two codes. Maybe your thinking is flexible, the idea is relatively clear, the brain is relatively fast, the feeling of the procedure is relatively keen, then you may prefer China's peers; maybe you are like me, the brain is more stupid, thinking is easy to confuse, need There are several temporary variables to figure out the situation, then you may prefer Japanese codes. It doesn't matter, which style can be. We are not difficult to guess, these two code is two implementations of the same function. As a project manager, I said, it doesn't matter which style do you like to use. As long as you have good quality, which style does not hinder your excellent programmers. Because the quality is not in these two styles.

So where is the quality? Just outside the two codes. Playing this code function, what kind of function name you gave it? Can this name let others understand its role? Does this function do not unit test? Can the function of the function, the error condition and the boundary value can be reflected in the unit test? This is the quality of the programmer. As long as you give each function, you can understand at a glance, as long as your function has a complete unit test, then you have the most basic quality of programmers. As for the code inside this function, how do you like it? - Maybe I should add "reconstruction"?

Object-oriented theory says "Programming for Interface", the same, programmers' quality is also reflected on the interface. If you come to others to see your implementation code, you have been questioned as the quality of the programmer. Still first in the function name, the unit tests these places.

转载请注明原文地址:https://www.9cbs.com/read-745.html

New Post(0)