Most Important Tips for Coding In PHP


PHP is very nice and lovely programming language, if you work with other people having good code is important.

Comment & Document

  1. Comments are very important because people understand why you are using certain function or block of code.
  2.  So adding comments above section of code should be better. After providing document of that code that is really nice.

Give Meaningful names into Variables, Functions and Classes

  1.  Given meaning full names in to variable because other programmers understand very easily

Example: $uname = ’’sudhakar’’; //not understand
Example: $userName = “sudhakar”; //every on easily understand

     2.   Function names and class names must and should give related work functionality

i) User registration somebody given
“user ()” or “user_r()” // these are not understand easily

Important Note:     every one must and should follow only one format of total project either camelCase or underscore
Example: userRegistration or user_Registration //…

View original post 110 more words