In order to preserve the consistent development of OTRS project we have set up a few guidelines regarding style.
1. Formatting ============= TAB: We use 4 spaces. ---- Braces: ------- Examples:
if ($Condition) { Foo(); } else { Bar(); } |
while ($Condition == 1) { Foo(); } |
2. Naming ========= Names and comments are written in English. Variables, Objects and Methods must be descriptive nouns or noun phrases with the first letter uppercase (e. g. '@TicketIDs' or '$Output' or 'BuildQueueView()').
3. Code header ============== Attach the following header to each source file.
# -- # (file name) - a short decription what it does. # Copyright (C) (year) (name of author) (email of author) # -- # $Id: developer-guide.sgml,v 1.1 2003/12/09 08:34:20 robert Exp $ # -- # This software comes with ABSOLUTELY NO WARRANTY. For details, see # the enclosed file COPYING for license information (GPL). If you # did not receive this file, see http://www.gnu.org/licenses/gpl.txt. |
4. Misc ======= All things depending on http://www.perl.com/CPAN-local/doc/manual/html/pod/perlstyle.html.
You can also use 'pb' the 'Perl Beautifier', http://www.arachnoid.com/lutusp/ftp/cgi/pb.txt. It's really nice. ;-)