Code/Markup Conventions
General Rules
- No spaces in filenames
- Only a-z,0-9 in filenames
- Filenames only start with a-z
HTML
- No Capital Letters in filenames, HTML markup,
- Use a js/css/img folder for the corresponding filetypes
- Use relative links unless a central PHP file is set with the rool URL and path information.
NEVER Use <font><b><i><center><justify>
- All HTML elements are in lowercase (xhtml)
- Large block elements start and end with a comment
- use ".html" not ".htm"
Programming
Variables |
Methods/Functions |
Objects/Classes |
only a-zA-z0-9 |
only a-zA-z0-9 |
only a-zA-z0-9 |
start with lowercase |
start with lowercase or "_" if private |
start with uppercase |
CamelCase multiple words (not "-" or "_") |
CamelCase multiple words (not "-" or "_") |
CamelCase multiple words (not "-" or "_") |
Comment on same line of declaration |
Comments before declaration |
Comments before declaration |
|
|
|
|
|
|
- tabs = 4 spaces ≠ TAB
- Indent inside methods, loops, logic, classes
Multiline comments with
- Try to declare variables at the top of methods/functions, scripts, and classes