Mailing List Archive

[Spamassassin Wiki] Update of "CodingStyle" by JustinMason
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Spamassassin Wiki" for change notification.

The following page has been changed by JustinMason:
http://wiki.apache.org/spamassassin/CodingStyle

------------------------------------------------------------------------------
}
}}}

- since these can have side-effects if your code accidentally calls {{{ $obj->foo($newval); }}} and $newval is {{{undef}}}. Instead, the more wordy Java/C++ style is preferred:
+ Instead, the more wordy Java/C++ style is preferred:

{{{
sub get_foo { my ($self) = @_; return $val; }
sub set_foo { my ($self, $val) = @_; $self->{foo} = $val; }
}}}
+
+ The reason why is detailed at PerlAccessorsConsideredHarmful.

* ''(status of this guideline: proposed by JustinMason. everyone happy with it?)''
* ''(+1 -- Daniel Quinlan except where we already do this)''