20 tips to become a better PHP Programmer

If you are a beginner in PHP programming here are 20 tips that will help you to become a better PHP programmer (as suggested by Marc on his post on webgeekly.com):
1) Use <?php and ?>
2) Separate Configuration Files
3) Comment, comment, comment
4) Use Indentation and Spacing (don’t be cheap on whitespaces)
5) Give your Variables Meaningful Names
6) Initialize your Variables
7) Boolean is False, unless True
8) Using Quotes when accessing Array Keys
9) Use commas to echo different strings
10) Use Ternary Operators
11) Use === for Boolean Checks
12) Use ++ and — Operators
13) Use Assignment Operators
14) Create a Variable Dump Function
15) Use Constants
16) Use $_GET and $_POST, avoid $_REQUEST
17) If your function has lots of paramaters use objects instead of functions
18) Use Method Chaining
19) Stop Repeating Code
20) Aim for Loose Coupling, Strong Cohesion

For full post (and explaination) check 20 Tips you need to learn to become a better PHP Programmer

One thought on “20 tips to become a better PHP Programmer

  1. Guys,

    I really want to recommended you if you are looking for programming language such as LINUX, RHCE, RHCSA and more. then Grras is perfect place for all of you. They are providing teaching in both ON-LINE and OFF-LINE mode.
    For more info please visit here :- http://rhceinjaipur.com/

Leave a comment