| From | Sent On | Attachments |
|---|---|---|
| Horsley Tom | May 25, 2000 10:31 am | |
| Chris Nandor | May 25, 2000 10:53 am | |
| Peter Scott | May 25, 2000 11:07 am | |
| Horsley Tom | May 25, 2000 11:27 am | |
| Steve Lane | May 25, 2000 11:47 am | |
| Chris Nandor | May 25, 2000 11:57 am | |
| Ben_...@trepp.com | May 25, 2000 12:27 pm | |
| (Simon Cozens) | May 25, 2000 12:30 pm | |
| Horsley Tom | May 25, 2000 12:32 pm | |
| (Johan Vromans) | May 25, 2000 12:44 pm | |
| Chris Nandor | May 25, 2000 12:59 pm | |
| Elaine -HFB- Ashton | May 25, 2000 1:20 pm | |
| David H. Adler | May 25, 2000 1:25 pm | |
| Peter Scott | May 25, 2000 1:34 pm | |
| Ben_...@trepp.com | May 25, 2000 2:03 pm | |
| Kurt D. Starsinic | May 25, 2000 2:14 pm | |
| Tom Christiansen | May 25, 2000 2:33 pm | |
| Tom Christiansen | May 25, 2000 2:41 pm | |
| Tom Christiansen | May 25, 2000 2:42 pm | |
| Tom Christiansen | May 25, 2000 2:44 pm | |
| Tom Christiansen | May 25, 2000 2:46 pm | |
| Elaine -HFB- Ashton | May 25, 2000 3:13 pm | |
| Chris Nandor | May 25, 2000 3:44 pm | |
| Tzadik and Sheva Vanderhoof | May 25, 2000 7:13 pm | |
| Robert | May 25, 2000 10:54 pm | |
| Matt Sergeant | May 26, 2000 12:21 am | |
| Horsley Tom | May 26, 2000 4:05 am | |
| Peterson, Jonathan | May 26, 2000 4:28 am | |
| Horsley Tom | May 26, 2000 4:36 am | |
| Adam Turoff | May 26, 2000 4:52 am | |
| Chris Nandor | May 26, 2000 5:14 am | |
| Elaine -HFB- Ashton | May 26, 2000 7:11 am | |
| Chris Nandor | May 26, 2000 7:22 am | |
| Tom Christiansen | May 26, 2000 8:01 am | |
| Dan Sugalski | May 26, 2000 8:20 am | |
| Matt Sergeant | May 26, 2000 8:28 am | |
| David Grove | May 26, 2000 8:50 am | |
| Elaine -HFB- Ashton | May 26, 2000 8:57 am | |
| Chris Nandor | May 26, 2000 9:31 am | |
| Adam Turoff | May 26, 2000 9:46 am | |
| Vanderhoof, Tzadik | May 26, 2000 10:14 am | |
| Elaine -HFB- Ashton | May 26, 2000 6:20 pm | |
| 'Elaine -HFB- Ashton' | May 27, 2000 8:12 am | |
| David Grove | May 27, 2000 7:10 pm | |
| Robert | May 27, 2000 9:24 pm | |
| Elaine -HFB- Ashton | May 27, 2000 9:48 pm | |
| David Grove | May 28, 2000 12:40 am | |
| Elaine -HFB- Ashton | May 28, 2000 7:22 am | |
| Jonathan Scott Duff | May 28, 2000 7:00 pm | |
| Robert | May 28, 2000 8:03 pm | |
| Chip Salzenberg | May 29, 2000 7:49 pm | |
| Chip Salzenberg | May 29, 2000 7:59 pm | |
| Chip Salzenberg | May 29, 2000 8:06 pm | |
| Ask Bjoern Hansen | Jun 3, 2000 9:00 am | |
| Uri Guttman | Jun 7, 2000 9:32 am | |
| (Simon Cozens) | Jun 7, 2000 5:13 pm | |
| Ask Bjoern Hansen | Jun 19, 2000 1:09 pm |
| Subject: | Re: Thoughts on maintaining perl | |
|---|---|---|
| From: | Ben_...@trepp.com (Ben_...@trepp.com) | |
| Date: | May 25, 2000 12:27:29 pm | |
| List: | org.perl.advocacy | |
Chris Nandor wrote:
At 13.31 -0400 2000.05.25, Horsley Tom wrote:
You may get the idea: You can be a perfectly competent programmer, writing perfectly wonderful perl code and it can *still* be virtually impossible for someone else to maintain.
I dunno, I am not sure I buy it. Can you give us an example of well-written Perl code that would be very difficult for another reasonably competent Perl programmer to maintain?
The full example would be long, so I won't include it here, but I will describe an issue I ran across. I had to learn some code written by an old Lisp fan. He had to deal with a table of data, each column of which needed its own formatting and validation rules. So he had a hash of information about each column, one field of which had a key called "format" which was the anonymous subroutine to format that field correctly. So you had a construct that looked like this:
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. You had a very well defined section of the code that was straight configuration information, and a different well-defined section of the code that was logic, and then the magic bit that combined them was very short, and almost never was what you had to change.
But I still believe that the above construct is either something you do consistently or something you should never try at all. Either declare it part of the learning curve or else avoid it. But do not randomly subject people to it...
Cheers, Ben
PS I later rewrote this to a faster and simpler form:
my @field_subs = map {$field_info{$_}{format}} @fields; # time passes print join ",", map {&$_($deal)} @field_subs;





