If you've ever had to go back to an application you wrote after an extended period of time, you already know the value of clean, well documented and efficient code. But how can you make your code better? Here are some tips that'll help you speed up and clean up your development cycle.
Articles preaching the virtues of writing clean code are abundant with good reason: some things bare repeating. Like any topic covering such an esoteric subject, there are a wide range of opinions as to what exactly defines "clean code". At the end of the day, there are two criterion for clean code:
Efficiency: Does the code run as quickly and efficiently as possible? Does the code make the most of it's objects and variables with maximum reuse and minimal waste?
Maintainability: Is the code easy to understand for other developers? Is it well planned, logical, properly documented, and easy to update?
This article will discuss the various elements comprising these two broad points regarding clean code, and provide examples in everyones favorite open source language: PHP. The target audience here is the beginner PHP programmer, although other levels of PHP programmers may find some useful information within.