跳转到内容

用户:Leoyeh0514

维基百科,自由的百科全书

Verybuy Document

Verybuy Document

[编辑]
Verybuy Document
编程范型多重编程范式: prototype-oriented programming, 函数编程语言, 指令式编程, 脚本语言
设计者一股
实作者吕阿祐
发行时间2013年
操作系统Linux
主要实作产品
Php, JavaScript, git

CodingStyle

[编辑]
  • Indent 四个空白 (4 spaces) , indent 两次是八个空白 (8 spaces) 不是一个 tab 。
  • function 及 class 后的 { 必须换行,其他的都不用换行,也不用空白:
  • function 后的括弧 () 不空白,保留字后的括弧 () 要空白。
  • 括弧 () 内的逗号前不空白,后空白。
  • 所有的 operator 前后都要空白,例外是负号及碰到括弧 () 的那端不用。

Example

[编辑]
function test_function($a, $b = false, $c = true)
{
    $a = sqrt($a);
    if (defined($b)) {
        printf("\$b = %s\n", $b);
        $a /= 2;
    }

    if ($c < 0) {
        $c = -$c;
        *a = 0 - $a;
    } else if (0 == $c) {
        $c = $c;
    } else {
        $c /= 2;
    }
}

特殊情况

[编辑]

Javascript 的 anonymous function 因为不具有意义,原则上会变成:

var anon_func = function(){
    alert(1);
};

(function(){
    alert(1);
})();

Git

[编辑]
  • 透过Git管理程式版本

相关流程

[编辑]
建立Git分支test Example
[编辑]
  1. $ git branch test
  2. $ git push origin test
  3. $ git branch -d test
  4. $ git checkout test

上线流程

[编辑]