Archive for the ‘naming convension’ Tag

Naming convention for Variable and other’s in PHP

  • Variable
    • Local Variable (lower case: EX. $stdtname)
    • Global Variable (Starts with a g: EX. gStudentname

Some Important Recognized variables:

i => Counter Variable

n => Count Variable

m => Represents n, if n is used

j => Represents i, if i is used

k => Represents i, if i is used

  • Class (Starting character is Capital: EX. class Maritalstatus)
  • Function (Camal Case: EX. function MyFunction()
  • Parameter/Argument (Starts with p, then camel case)
  • Instantiate (Class/Object starts with m, then camel case)
  • Controls (Starts with meaningful short name, then your chosen name in Camel Case: Ex. txtPersonName)
  • Form Elements (Starts with frm, then your chosen name in camel case: EX. frmMyForm)

implement

Database Name: Represent/Separate it by underscore to have a Meaning full name. Name should be all lower case (By Default MySQL treats database as lower case, what ever name you give it)

Table Name: Lower case, Separated by underscore (If needed)

Field Name: Should be meaningful and Camel Case.