[JOB] Perl Software Developer and Database programmer
Andy Armstrong
andy at hexten.net
Thu Feb 23 13:00:03 GMT 2006
On 23 Feb 2006, at 12:03, Peter Hickman wrote:
> All very clear is it not, but you now have to ask "what does
> make_page_links() actually do?". Here we find
>
> sub make_page_links {
> return join(' - ', @_);
> }
>
> Just what is the point of this, it did not even get called in other
> parts of the code. He claimed he was 'abstracting away the
> complexity of the code'.
I'm not completely opposed to that. Again it depends hugely on the
context - but wrapping even a tiny bit of code like that in a
descriptive name can - in some circumstances - have value as
documentation. For example I've just written
sub feed_name {
return show_name(@_);
}
Which makes perfect sense to me - at the moment the name of a feed is
the same as the name of a show - but that might change. This way, if
it does change, I don't have to go looking at all the instances of
show_name() to find out which of them should actually do something
different to get the name of a feed.
--
Andy Armstrong, hexten.net
More information about the london.pm
mailing list