develooper Front page | perl.perl5.porters | Postings from May 2000

Re: Thoughts on maintaining perl

Thread Previous | Thread Next
From:
David H. Adler
Date:
May 25, 2000 13:25
Subject:
Re: Thoughts on maintaining perl
Message ID:
20000525162544.A6906@panix.com
On Thu, May 25, 2000 at 03:27:51PM -0400, Ben_Tilly@trepp.com wrote:

>   print join ",", map { &{$field_info{$_}{format}}($deal) } @fields;
> 
> It took me some time to figure out what that construct meant and where
> the actual formatting information was.  His argument was that this was
> a perfectly fine thing to do.  He did it all of the time, and it
> allowed you to separate presentation from content.  He admitted that
> the first time you saw it, it looked a bit strange, but if you knew
> what it did...
> 
> That turned out to be a good lesson for me.  This construct really was
> integral to his style, and once I got past the shock of that line it
> really was maintainable.

The question that springs to my mind is "was there a comment
explaining this?"  If not, would that have prevented it from "stopping
you in your tracks"?  Also, if not, hurt that man. :-)

It seems to me that if you have code that might look a bit obscure,
but can be comprehended with little trouble if you know what it's
*supposed* to do, then you *tell* people what it's supposed to do.

Again, not an issue with the language, but with the programmer.

*sprinkles IMHOs around to cover his tracks*  :-)

dha

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
We went on holiday by mistake	- Withnail

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About