Day#81 C' Coding Challenge

Day#81 C' Coding Challenge

List some of the best practices for programming?

1. Follow the latest C standards while programming
2. Add comments throughout the code for better readability
3. Variables must be named in such a way that the their purpose is clearly understood
4. Save your code at regular intervals, this helps to save the written code in case of  any unexpected power/system failures
5. Code must follow proper indentation 
6. Pointers must always be initialized
7. How many of us follow proofreading. It is very good practice to read the code once written and then compile and debug.
8. Semantic errors should be taken care. These errors occur when compilers doesn't understand the statements written
9. Overflow scenarios to be avoided and there should be regular checks
10. Every programmer can write a program. The major difference between the successful and unsuccessful programmer is that successful programmer doesn't just think about a working code but also failure scenarios and handles them in the code even before release
11. Using flow charts, state machines are best ways to break a large code into small chunks
12. If a programmer has a huge code to be written in place, it is better that he breaks down the code into small functions, use tools like Dev C++ to write logic, check it's functionality and integrate into main code
13. Pointers should always be checked for NULL
14. Proper brackets must be used for arguments in MACROS
15. MACRO names must be written in capital letters
16. Exception handling mechanisms must be implemented (Example: Division by Zero)

Post a Comment

0 Comments