[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 5235: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3899)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 5235: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3899)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 5235: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3899)
Design Forms • Coding Standards
Page 1 of 1

Coding Standards

Posted: 16 Jul 2014, 06:48
by PetrS
size=150Coding Standards/size

There are proposals for Coding standards in SDF.
Feel free to comment it or add another rules.

ubRules division:/b/u
color=#FF0000A(utomatic)/color - This rules are keeped by SDF_builder automatically
color=#FF0000M(andatory)/color - This rules should be always used. Their use should be mandatory.
color=#FF0000H(ighly) R(ecommended)/color - This rules are important, but not mandatory.
color=#FF0000R(ecommended)/color - This rules are reccomended.


ub§1. The apperance of the source code/b/u
b§1.1. Syntax and formatting/b

u§1.1.1. Offset (A)/u
SDF doing offsets automatically

u§1.1.2. Braces (M)/u
First brace have to be at the end of line
Internal code block is deeper by tabulator (A)
Ending brace have to be solo on the new line. Only exception is IF - ELSE

example:
IF (...) {
code
} ELSE {
code
}
FOR (...) {
code
}

u§1.1.2.1. Braces in one row command (M)/u
Even if command is on one row, there is necessary to use 3 row notation

example:
IF (...) {
return false;
}

u§1.1.2.2. Bracers in Switch - Case (M)/u
This is just an application of above rules

example:
SWITCH (A) {
CASE 0: {
code
}
CASE 1: {
code
}
}

u§1.1.3. Every command have to be on separate row (M)/u
Semicolon mark or bracers have to be at the end of every row

example:
IF (...) {
return false;
}

u§1.1.4. Comments (M)/u
Comments should be in English.
If is necessary to use other language (czech, dutch), add author's mark (KRS, SLE...)
Also do not use diacritic.
Preffer use // for comments, instead of "/*comment*/"


u§1.1.4.1. Older parts of code as comment (HR)/u
Try to do not use comments on older parts of code. Code will become confused.
If the older code is necessary, add author's comment and mark.

u§1.1.4.2. Code comments/u
Code should be selfcommenting.
If necessary use comments for blocks, variables, cycles...

u§1.1.5. Pagebreak()(M)/u
Use Pagebreak() on the top and bottom of IMG command, so the picture can be deleted from MS word, if it is exported.
Always check the pagebreaks in brief output, where vizual components are in more columns. If pagebreak cut this, the whole code must be placed to the Block{}.(M)



ub§2. Translation/b/u
§2.2. How to divide texts
Separate mathematical formulas from text which should be translated. (M)
Do not use BR. (M)

§2.2. Removing string from translation
Remove all possible strings from translation by checkbox:
- mathematical forms in Text command
- symbols
- variable name which is used in Text command (M)