http://www.perlmonks.org?node_id=131383


in reply to Re: Two-arg open() considered dangerous
in thread Two-arg open() considered dangerous

Good engineering is sometimes about minimizing the likelihood of something bad happening. Compare the legal concept of "attractive nuisance": If you have a swimming pool in your back yard, you're responsible for putting a reasonable fence around it. Those who design programming languages and other interfaces aren't doing their work very well when they create new and easier opportunities for self-fornication.

    -- Chip Salzenberg, Free-Floating Agent of Chaos

Replies are listed 'Best First'.
Re: Re: Re: Two-arg open() considered dangerous
by rob_au (Abbot) on Dec 13, 2001 at 04:37 UTC
    I have to say that I disagree with you here chip - The concept that the language designers should limit an interface to shield even only potentially unfriendly arguments, particularly where such arguments may be perfectly valid (as described by merlyn above), is in itself flawed. Perl has always been described as "providing enough rope to hang yourself with" - I would much rather take those steps of good engineering than sacrifice any power within the underlying language interface.

     

    perl -e 's&&rob@cowsnet.com.au&&&split/[@.]/&&s&.com.&_&&&print'

      Well of course there's a balance, rob. But I'm rather tired of excuses for poor design decisions that make writing robust software more difficult without any real gains.

      Why couldn't three-arg open have been in Perl from the start of its being a full language, i.e. 3.0 or so? It should have been.

          -- Chip Salzenberg, Free-Floating Agent of Chaos

        For the most part, I think this is probably simply a result of language evolution - I'm sure that even once Perl 6 is released, we'll still be finding syntactical anomalies that could better be rewritten and indeed most likely will be.

        Don't get me wrong, this statement isn't meant to dissuade your argument, but rather support it - I see great value in your comments and its such comments that are required to drive changes. However, as with all aspects of Perl, its "perfection in progress" ;-)

         

        perl -e 's&&rob@cowsnet.com.au&&&split/[@.]/&&s&.com.&_&&&print'