Coding style
A list of coding style rules to be used when developing in vtenext.
| File encoding: | UTF-8. All files should be encoded in UTF-8 | ||||||
| Newlines: | Unix style, so \n, not \r\n or \r | ||||||
| Indentation size: |
With TABS, set to 4 character. Don't mix spaces and tabs:
|
||||||
| Indentation style: |
C Style, so:
Please note that these style rules are not strictly observed throughout the existing code, so you may find exceptions. Try to follow them, to improve the code homogeneity, but don't be too rigid in following them when evaluating existing code.
|
||||||
| Line length: |
We don't have a strict maximum line length. Usually up to 200 characters is ok, more than that can be hard to read on smaller screens, so better to split the line, but this is left to the developer's choice. Also, splitting too much, for example a 300 chars line divided in 30 lines of 10 chars is no more readable than the original line. Balance readability and conciseness of code. |
||||||
| PHP tags: |
Use standard opening tag: Avoid the closing tag (
|
||||||
| Auto formatting: |
|
||||||
| License: |
When creating a new file (php, js, tpl, html, scss) to be included in the standard vtenext, use the following license at the top of the file:
|
||||||