[Wellington-pm] Roundup of last night's meeting

Matthew Hunt matt at catalyst.net.nz
Tue Aug 12 21:26:52 PDT 2008


Grant McLean wrote:
> Hi Mongers
> [...]
> 
> Further to last night's discussion on the subject of dealing with legacy
> code, perhaps people could reply here with a few points that may have
> been mentioned last night but also may have been forgotten.  My 2
> cents ...
> 
> [...]

One point that shouldn't be overlooked is that you should make sure that 
you're using prototypes correctly if you're using them at all.

The anonymised code on display was, in places, only working at all 
because the prototypes that were (possibly erroneously) there were being 
ignored due to the order of the calls and the subroutines.  Also the 
coder who shall not be named had a tendency to call functions with a 
preceding ampersand:

  "&NAME(LIST);   # Circumvent prototypes." -- perlsub(1)

In any case, it makes little sense to have code like:

sub foo() {
    my $bar = shift;
    # et cetera
}

Matt.
-- 
Matthew Hunt


More information about the Wellington-pm mailing list