2 February 06
Tip No 2
Always try to format your php code to your own standard, and include lots of comments throughout your code. Make sure your standard is readable and provides an easy break down of your code, especially for someone who has never seen your code before. Once you have developed your own standard, keep to it, it’s as simple as that. Here are some rules I have for my “standard”:
- I never keep more than one statement on a single line
- I always use brackets with if() (eg. if($this 'that'){ dostuff(); } instead of if($this ‘that’) dostuff(); )
- I always indent my code one tab when inside if, while, for, foreach and function/class definitions
- I generally try to use /* */ only sometimes at the top to explain the code, I then use // to explain lines of code
Good luck!

