Intelligence program is good program! 有智慧的程式就是好程式!

I have read and refactor quite a few projects/programs that coded by my colleagues or former colleagues. And of course refactoring my own projects source code too. Here is something that I feel deeply in my heart.
Just like how to define beauty, how to define what is a good program or coding practice is not something that has an exact correct answer. But there is some traces or characteristics which make you feel like, Ah~ this is good. On the contrary, some of them give you, Oh~ da#n it, you son of the bXtch!
There is one very remarkable thing that justify a program or source code between these two is, is the program smart or not?
If a program doesn’t do any checking or validation to the input, or do nothing about controlling the input, it is stupid.
If a programmer do not think about “what if something like that happen”, do nothing about it, for example, what if the connection is broken during some process, he is stupid.
If a program that doesn’t contain any setup or setting for the user when it should, definitely stupid.
If a programmer *assume* something or anything when writing the program, for example, assuming you have the administrator right. The outcome program will be very stupid.
If a programmer compile a program, success, and go through a perfect procedure using the program, telling you that he/she has done testing it. The program and the programmer is both stupid.
These sorts of look like stupid mistakes which you and I may think you will never make are the most command mistakes I encounter during my refactoring process. So what is going on?
You know what, stupid programs comes from stupid programmers.


Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s