2. Self Introduction
Oriented By: YOEUNG Vibol
Working at Webridge Technologies
Skype: vibol.yoeung
Email: yoeung.vibol@gmail.com
3.
Why we care about code?
What we need to care?
What can help?
How to format html&css code
How to format php code
Techniques to write code
Question and Answer
Agenda
4. Why we care about code?
l
Easy to read
l
Easy to maintenance
l
Enjoy coding
l
Standard and professional
l
…....
5. What we need to care?
l
Naming convention
l
Indention
l
Tab
l
Split line
l
Enjoy coding
l
Trailing white space
11. How to formate php code?
l Class names MUST be declared in
Upper Camel Case
l Class constants MUST be declared in all
upper case with underscore separators.
l Method names MUST be declared in
camelCase
l Code MUST use 4 spaces for indenting,
not tabs.
12. How to formate php code?
l lines SHOULD be 80 characters or less
l New line for Open & close braces for
class method
l The PHP constants true, false, and null
MUST be in lower case.
l Add comment for all method
l Always open with <?php and close
with ?>
14. Technique to write code
Yoga conditions
Use Yoga conditions
•
Right side variable, left side constant or literal.
•
Prevents assignment
•
Prevents logic error