Turning from Delphi to C development, although not a simple grammatical format problem, in the end of Delphi, I have accumulated OO experience, and I also developed my own coding style. However, in recent days, some companies have some internal documents and some open source code on the Internet. The writing of these code has a deep sense, and the people who truly participate in the formal open source project developed on Sourceforge, must write format memory for their code. new! Take a look at the open source code from the Internet, it is simply ... If you want to go, the employer requires the write code when the interview is right, and the ever code work is also That's right, at least avoid some garbage code makers. I think some of the following code is written by "Irregular", I will definitely not recruit:
1. Take the annotate. You - Mom - the other people are mentally wisdom, the whole code writes all the comments, is it necessary? What do you know? If it is an older programmer, look at your code, you can't bring yourself! The so-called comment, not to give each code to have a text description! Instead, you will make you think about the current important code segment, the variable's meaning, so that others can easily understand your thoughts! Do you have any explanation of a loop variable i? I rely on, I sue you!
2, the function body does not add Tab or no two-grid spaces to write directly. This kind of code looks at, and this person directly passes, never hire.
3, write multiple statements in a line! Boss, you are using computer write programs, electronic file! Didn't let you write the company with your home printing paper, why are you so stunned? Only write a statement, there is no big impact on you, please?
4, empty While cycler does not add {}. People who write this code are people who have a trap to others. If the IF condition is more, it doesn't know how to change the rail plate, with this class!
Don't think you - he - Mom - the program function is implemented, you will write the program! "Write" well and "writing" is bad, but the difference is big, kid, practice your own code style, then come out, you will write the program! They are all mixed, you - he - Mom also makes people who look at your code for more than two days. It's still going to have morning and evening, right? !