7 Principles of Great Coding
Make your code reusable
Each chunk should only do one thing. This keeps things simple, and allows you to re-use you code chunks. Re-use will shorten your development time. Chunks of code with only one purpose makes it easier to troubleshoot problems.
Reduce connections between chunks of code
Variables should not be shared between chunks of code. This kind of sharing makes your code unneccessarily complex. If you have to modify something in one chunk, the dependent chunks may have problems.
Validate data
To prevent errors and maintain clean data, make sure you always validate your data. This involves checking the data to make sure it is in the format you want before you process the data with your code.
Provide error handling
Once you have validated your code, make sure you provide good error handling, so the problems get solved. It it bad practice to just make your code end the application.
Make sure our code works while you are writing.
Don’t leave known issues open. It is tempting to make a list of issues to tend to later, and continue coding to stay productive. Stop coding and fix your problems. It will only be more time consuming and more complex to solve multiple problems later.
Make your code readable
Informative names for your variables make code easy to understand. Whether you will be the one making changes or someone else, it is easier to read code that is written in a descriptive way. Instead of naming your variables a or b, name them for what they represent, like height or weight. Use comments to explain what your code does.
Make a plan
Finally, you should be organized when you code. Have a plan. Don’t just sit down and start coding randomly. Well organized code can save you time, because you can plan for reuse.
A potential benefit of running the any code on the server side is that in addition to being hardware/software agnostic, it is more or less transparent to the user. That is to say that the user never has to download any software required to utilize a PHP-driven site other than a supported browser. Article Source:http://www.articlesbase.com/web-hosting-articles/7-principles-of-great-coding-1276305.html