Revision 1 - 2009-04-27 at 01:35:39

MojoMojo development best practices

Below are the currently agreed-upon development practices for writing MojoMojo code. Discussion are welcome at discussion.

Code tidiness

  1. in Perl code, use 4-space indentation. No tabs.
  2. in Template::Toolkit code, use 4-space indentation for HTML code, and 2-space indentation for TT code. See rationale and examples at Indenting TT and HTML.
  3. line length is 120 characters per line. Nobody really uses 80-character lines, and we don't print out code. If you are using Perl::Tidy to automatically format your code according to PBP pages 34-35, you can achieve this via:

    perltidy --perl-best-practices -l=115
  4. ideally, your code should pass Perl::Critic on at least the gentle setting.

Development best practices

  1. All testable functions should have tests
  2. Every module and function should have POD documentation
  3. For JavaScript, use jQuery.
  4. HTML output should be XHTML 1.0 Strict
  5. CSS 2.

See also

My tags:
Popular tags:
Powered by Catalyst