作者chhuang (我是瓶男我很难懂)
看板perl
标题Re: [问题] perl程式的维护性
时间Fri Mar 3 09:20:42 2006
※ 引述《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