Write 10 cheats for the C program

Source: Internet
Author: User
Write down the 10 secrets of the C program-general Linux technology-Linux programming and kernel information. The following is a detailed description. 1. You should frequently urge the lint tool. According to its syntax statement, the internal force of the study is determined by the consideration of lint.
2. Do not follow the NULL pointer. Otherwise, the chaos will be on the other side.

3. If you have the talent, wisdom, and knowledge of the problems, you should also force the migration function parameter to be the Data Type of the prototype, so as to avoid temporary negligence, causing the data type to be paid back to you.

4. If the header file does not declare the type of the return value in the function prototype, you should be cautious when it comes to this matter to prevent unexpected arrival.

5. Check whether the cross-border operations of the string and array operations are required. The sage of the ancient times has a saying: I want to say "yes" to those who pray, and I don't have to worry about it. I don't have to worry about it. He will thank you more and more. "-the period is short, the length obtained. This is an array, which is the most dangerous.

6. If it is mentioned in the function declaration, the error code cloud will be returned in case of an exception. You should carefully check the returned value. Or there are checking statements that increase your code several times, which makes your finger so painful as to press the key. Otherwise, you will surely see this exception, and go to God to punish your arrogance.

7. You should study database functions and overwrite them manually. If so, your code will be short and easy to read, and your mood will be fresh and bleak.

8. If you do not want to, you should also use parentheses and indentation to make your code clear and can be used for reference by the latter. The great wisdom of Ru can be used to solve the problem, while the great wisdom can be used to lay the mysteries, and the chaotic style can never be used.

9. The first six characters of the external identifier must be different. This Law may seem crude, and the law may last forever. If you do not say this again, you will be scratching your ears when you want to connect the program to the old work.

10. There may be a family, and the cloud is not VAX ". In these ways, let alone, cut off, and avoid them. Even more strange, believe in the magic road, think that the use of the computer frequent replacement, your program can also be applied for a long time. Do not communicate with such wicked people, please remember.


How to write the worst C Language Program

1. Rewrite the standard library function and change the function name to an obscure name that you only know.

2. Use obscure, personalized, and unportable function libraries so that you will never leave your favorite platform.

3. Before calling all functions, use comments that can accurately describe functions, such as printf ("Hello world \ n ");

4. Remember: Only cainiao can use line breaks in the Code. Only cainiao apprentices can use tabs. Experts will add countless Embedded Assembly commands to the code.

5. The "User Interface" is designed for low-performance students. "users" will never deal with your programs through the interface.

6. If you have to comment out your code, just pull a few comments from other people's code and put them in your code. This is the fastest and easiest way, and when you see other people reading your code with a strange expression on your face, how happy it is.

7. Use precompiled options as much as possible, and use the new macro definition as much as possible to replace the existing macro definition in the function library. This is called "Do your best ".

8. You don't have to worry about the code details. The compiler will help you with everything.

How to test the worst C Language Program

1. As long as your code has been compiled, the problem must be found in other people's code.

2. If all your code is written, the problem must be in untrusted function libraries.

3. Report to the tester: the error report is a mean lie that tarnish my reputation as a C-language programmer! Why are you doing this? You can't even read my code smoothly. How do you know there are errors in it?

4. If the tester can smoothly read your code, you may not be able to write any bad code.

5. Announce that if the stingy companies (or schools, wives, etc.) are willing to buy you a C ++ compiler, there will be no errors in the program.

6. insert or delete blank lines anywhere in the code, recompile and execute them.

7. If you have any problems, rewrite your program in assembly language. This will not reduce program errors, but it will ensure that no one can find the wrong location, and no one can degrade your programming capabilities.
Related Article

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.