User: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

上線流程[编辑]