In this post i am sharing the best Rules of Programming. The following are the Golden Rules
- Make sure you understand the problem you’re trying to solve.
- Prioritize clarity and correctness. Performance is less important, and cleverness is to be avoided.
- If your code needs comments to be understood, it’s over-complicated.
- Always comment your code, or at least your modules.
- Extensibility and reusability are over-rated.
- Don’t innovate security. Use well-established security libraries.
- If you haven’t tested it, it probably doesn’t work.
- If you have time to ‘go back and fix it later’ you’ve got bigger problems in your job.
- Integrated Development Environments (like VisualStudio) and the internet (e.g. StackOverflow) are the best friends a coder could ever have.
- printf is the world’s simplest debugger.
- Don’t quickly agree to the timelines given by your PM. He wants you to deliver it yesterday. Take your time to understand the problem and factor the time for design , testing, code reviews, changes, documentation etc .
- Spent time designing the solution. Create Data Models , Data flow diagrams etc. This will help you to think as well.
- See if you can utilize a existing system. Why spent time and money on creating something new. You need to socialize your design to get those ideas.
- Get your design reviewed. Remember any changes in design phase are so much easier.
- Always keep an open mind and don’t hesitate to throw away your code and start fresh if you feel so.
- Don't shy away from getting help if you need.
- Always use libraries or tested code. Don’t try to write lot of low level code, if you don't have to.
- Think about performance at the design time itself. You don't want to create a system and then worry about making too many changes write before delivering to QA.
- Do lots of unit testing. Put lots of debugging messages in your code. Keep an eye on error logs and fix any issues before pointed to by QA.
- Don't book your Vacation right after production release :-)
No comments:
Post a Comment