Monday, September 14, 2009

Is Coding Standard Necessary?

Last week, I worked on refactoring my code. One major task was adapting the coding standard. After gone through the coding standard, I realized that most code I wrote before did not follow the standard. It is because most of the time I just code by myself, and I don't think other people will ever try to take a look of my code. In that case, no matter how I write the code, it should be easy for my to catch on later. However, it does not work that way. Sometimes when I work on a complicate program, it took me quite a long time to understand the code, even though it is written by me. I think keep the code in standard is seriously important. It will make the code more readable and more organized. The most important thing is that it will bring you a good mood while coding. I used to work on debugging some old code. When I saw some messy code, I just felt so exhausted and desperated. Usually, that is a pretty bad thing:(

I agree with most the standard, but there are several rules that I am not so sure. The top thing bothers me is puting the open brace at the end of the line. I really see no differece between putting the open brace in a new line. To me, putting the open brace in a new line seems more organized and easy to read.

Anyway, I think it is a good time to start following the coding standard. Although you might need some extra efforts to made the documentation, it will definitely pay you back in the future.

Here are the links that put my new RoboCode source code:

No comments:

Post a Comment