diff options
| author | Paul Buetow (pluto.buetow.org) <paul@buetow.org> | 2013-09-08 09:19:52 +0200 |
|---|---|---|
| committer | Paul Buetow (pluto.buetow.org) <paul@buetow.org> | 2013-09-08 09:19:52 +0200 |
| commit | 43b907a0e59da5e1c3cf5e86e80909184d1441f9 (patch) | |
| tree | 71149015765805f3332b708bf7090e829180c3ed /README | |
| parent | 0663db22aea0342e9ecaf0257e9c7ebb67537022 (diff) | |
retab
Diffstat (limited to 'README')
| -rw-r--r-- | README | 98 |
1 files changed, 50 insertions, 48 deletions
@@ -1,71 +1,73 @@ +STYLEGUIDE: + Always do: -- Pragmatic modules ALWAYS to use in ALL packages: +Pragmatic modules ALWAYS to use in ALL packages: - use strict; - use warnings; +use strict; +use warnings; -- Only for packages for including package UNIVERSAL definitions +Only for packages for including package UNIVERSAL definitions - use Xerl::Page::Base; +use Xerl::Page::Base; -- Object oriented coding style +Object oriented coding style -- Always use method prototypes if possible +Always use method prototypes if possible - sub foo($;$) { .... } +sub foo($;$) { .... } -- Explicit object typing if possible +Explicit object typing if possible - my Class::Name::Here $foo = Class::Name::Here->new(); +my Class::Name::Here $foo = Class::Name::Here->new(); -- If no real ret val, set undef; explicitly +If no real ret val, set undef; explicitly - sub foo() { - # Do some stuff - ... - # Set explicit undef ret value - return undef; - } +sub foo() { + # Do some stuff +... +# Set explicit undef ret value +return undef; +} -- Private subs use _ as its prefix and are called only from the current package. +Private subs use _ as its prefix and are called only from the current package. - package Xerl::Foo::Bla; - . - . +package Xerl::Foo::Bla; +. +. - sub _iamprivate($) { - my Xerl::Foo:Bla $self = $_[0]; - . - . - } +sub _iamprivate($) { +my Xerl::Foo:Bla $self = $_[0]; +. +. +} - sub iampublic($) { - my Xerl::Foo:Bla $self = $_[0]; - $self->_iamprivate(); - return undef; - } +sub iampublic($) { +my Xerl::Foo:Bla $self = $_[0]; +$self->_iamprivate(); +return undef; +} -- Static subs (not OOP) are in CAPITAL letters. +Static subs (not OOP) are in CAPITAL letters. - sub IAMSTATIC($) { - print shift; - return 'Hello World'; - } +sub IAMSTATIC($) { +print shift; +return 'Hello World'; +} - sub iamdynamic($) { - my Xerl::Foo:Bla $self = $_[0]; - return Xerl::Foo::Bla::IAMSTATIC( $self->get_somevalue() ); - } +sub iamdynamic($) { +my Xerl::Foo:Bla $self = $_[0]; +return Xerl::Foo::Bla::IAMSTATIC( $self->get_somevalue() ); +} -- Static private subs start with _ and are written in CAPITAL letters +Static private subs start with _ and are written in CAPITAL letters - sub _IAMSTATICPRIVATE() { - . - . - } +sub _IAMSTATICPRIVATE() { +. +. +} -- Use Pidy to automaically restyle the code! (make pidy) +Use Pidy to automaically restyle the code! (make perltidy) -- Mark things which are still to do with TODO: at any place in the source - tree. (Can be searched for using 'make todo'). +Mark things which are still to do with TODO: at any place in the source +tree. (Can be searched for using 'make todo'). |
