Re: [問題] perl程式的維護性
※ 引述《knep ((cynical.))》之銘言:
: ※ 引述《easy1 (e :) y)》之銘言:
: : 我是有想過
: : 訂出一套styleguide寫code的guideline
: : 而且寧可使用最簡單最不精簡的syntax(寫起來像c的perl碼!?)
: : 不然像有CPAN這樣的Perl真是令人捨不得放棄
: : 不知道大家有什麼建議
: Perl::Tidy - Parses and beautifies perl source
: http://perltidy.sourceforge.net/Tidy.html
Perl Best Practice http://www.oreilly.com/catalog/perlbp/index.html
Code Layout 的重要性,並且建議如何設定 .perltidyrc。
-l=78 # Max line width is 78 cols
-i=4 # Indent level is 4 cols
-ci=4 # Continuation indent is 4 cols
-se # Errors to STDERR
-vt=2 # Maximal vertical tightness
-cti=0 # No extra indentation for closing brackets
-pt=1 # Medium parenthesis tightness
-bt=1 # Medium brace tightness
-sbt=1 # Medium square bracket tightness
-bbt=1 # Medium block brace tightness
-nsfs # No space before semicolons
-nolq # Don't outdent long quoted strings
-wbb="% + - * / x != == >= <= =~ !~ < > | & >= < = **= += *= &= <<= &&= -= /=
|= >>= ||= .= %= ^= x="
# Break before all operators
--
我是瓶男~我很難懂!
http://blog.yam.com/chhuang
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.30.74.102
討論串 (同標題文章)
Perl 近期熱門文章
PTT數位生活區 即時熱門文章
11
21
11
17