Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

RE: RE: Shot myself in the foot with a pos

by chip (Curate)
on Aug 11, 2000 at 04:29 UTC ( #27425=note: print w/ replies, xml ) Need Help??


in reply to RE: Shot myself in the foot with a pos
in thread Shot myself in the foot with a pos

I think it's a bad idea to let readers off the hook when it comes to any language rules, including precedence rules. The whole language is there for me to use when appropriate, and I'm not going to take very well to instructions to back off some construct just because it takes a little research to understand the first time.

    -- Chip Salzenberg, Free-Floating Agent of Chaos


Comment on RE: RE: Shot myself in the foot with a pos
RE (3): Shot myself in the foot with a pos
by tilly (Archbishop) on Aug 11, 2000 at 04:58 UTC
    I think if I took that attitude when I started at my current job I wouldn't have wound up being asked to train most of the other programmers how to use Perl.

    I wholeheartedly agree that any good Perl programmer should know the precedence rules. That does not mean that their code should be written using them all if you have any expectation that it will someday have to be altered by someone not as conversant as you.

    But this is a disagreement we won't settle any time soon. One of my sillier mistakes was to have this argument with Tom C. You know that I deliberately limit myself to a set of constructs that I think I can teach to others. The one I was responding to is simply not common enough for me to want it on a short-list of things I have to teach. OTOH another time I showed a construct I had to deal with (that was written by someone else) to p5p and got general shock and horror about how convoluted it was. Plus one of my favorite quotes ever on programming from Tom C:

    A programmer who hasn't been exposed to all four of the imperative, functional, objective, and logical programming styles has one or more conceptual blindspots. It's like knowing how to boil but not fry. Programming is not a skill one develops in five easy lessons.

    I think that when there are valid and valuable constructs that can cause that much reaction on a list with as many tuits as p5p, it is beyond the bounds of reason to expect most companies to have people who could maintain a code-base that uses all of them.

    For bystanders, the construct handed to me is this:

    print join ",", map { &{$field_info{$_}{format}}($deal) } @fields;
    I pointed out that I had cleaned it up. Thanks to merlyn it got cleaned up a bit more, and this construct shows up from time to time in my code like this:
    my @field_subs = map {$field_info{$_}{format}} @fields; # TIME PASSES print join ",", map {$_->($deal)} @field_subs;
    In fact a variation of it appeared in my first post here, at A few style suggestions.
      I'm wholly in favor of making things maintainable, and I have no interest in gratuitous confusion. So I think we are in broad agreement.

      However, when I'm under a deadline, I simply don't have the time to optimize for readability; I have to optimize for speed of programming and ease of debugging (that's debugging my own code, BTW :-)). And the shorter my code is, the less likely it is to be broken.

      I'm reminded of something Kipling is reported to have written: ``I apologize for the length of this letter, but I had no time to make it shorter.'' In constrast, writing short Perl code is easy; when I'm programming for money, I have no time to make it longer.

          -- Chip Salzenberg, Free-Floating Agent of Chaos

        You have just hit on one thing I love about Perl. Perl is a true master at the, "keep it short and sweet" school of maintainability. People who think about keeping million line projects under control tend to lose sight of the fact that that is even possible!

        One thing that novices forget. Optimizing for the ease of debugging in the end is a very good way to optimize for the speed of programming as well. People say, "I didn't have time to think about that" and then wonder why they seem to spend all of their time tracking down bugs...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://27425]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (11)
As of 2014-07-30 19:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (240 votes), past polls