OTRS CVS - Manual
Prev |  | Next

# Chapter 24. Developer's guide

This chapter will show you more details about writing common OTRS Modules.

# Coding Style Guide

In order to preserve the consistent development of OTRS project we have set up a few guidelines regarding style.

## Formatting

TAB: We use 4 spaces.

Braces examles:

     if ($Condition) {
         Foo();
     }
     else {
         Bar();
     }

     while ($Condition == 1) {
         Foo();
     }

## 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()').

## 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.2 2004/03/28 11:13:47 martin 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.

## 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. ;-)

Prev | Home | Next
Problems - misc |  | OTRS Framework