Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re: Think for yourself.

by Abigail-II (Bishop)
on Oct 06, 2003 at 08:27 UTC ( #296885=note: print w/replies, xml ) Need Help??

in reply to Re: Think for yourself.
in thread is the use of map in a void context deprecated ?

That "three line patch" is one of thousands that bloats Perl.

If an optimization that only takes three lines "bloats" Perl, then you must have been an unhappy camper ever since Perl 5.000 came out. If you already consider this bloat, how do you feel about statement modifiers? What about having unless? What about short cuts like +=? Or having two kinds of for/foreach, a while, and an until? Shouldn't that be all bloat because we have goto?

It isn't as if this sort of practice is un-Perl. After all, Perl is the language that encourages people to use operations like "tr/a/a/" to count the number of a's in a string.
Funny that you bring this one up. For a long time, "tr/a/a/" modified the string it was working on (replacing every 'a' with an 'a'). Noone considered that bad style. And still, after a couple of years, this operation was also optimized. Do you consider that 'bloat' as well?

I use Perl because it is practical. I don't use it to ensure that non-Perl-familiar members of the community will be unable to understand my code.
You must have a limited view of the world of programming languages. The non-Perl world is bigger than Java. There are languages in which map like constructs *are* the way to iterate over an array. In fact, I know more languages that use map like constructs to iterate over an array (or list) than I know that use 'for (LIST)'. And outside of Perl, I do not know any that uses 'EXPR for LIST'.


Replies are listed 'Best First'.
Re: Re: Think for yourself.
by MarkM (Curate) on Oct 12, 2003 at 05:25 UTC

    With regard to my bloat argument, you have purposefully exaggerated your defense by mentioning operators that provide unique benefits that are impractical to not use. += is impractical to not use. Statement modifiers are impractical to not use. Map in void context is not nearly as necessary of a construct.

    With regard to the tr/a/a/ that I mentioned, it isn't funny that I brought this up, nor is it a coincidence. I am admitting that the language has a precident for providing behaviour in un-obvious or circular implementation, that is at some point optimized for general use. Do I consider it bloat? I sure do. I brought it up, after all.

    As for your last attempt to insult me, I suggest you re-think your motivations. I rarely ever use Java. My day-to-day programming at work is almost 100% Perl, and has been for several years.

    You may think Perl is perfect. I don't. I am forced to admit that Perl is practical, and so I use it. Note the difference. Not all the world is Abigail, or Perl. Didn't you just say, in this very thread, "Think for yourself"? I am thinking for myself, and you are criticizing me for it. I suppose "there is more than one way to do it" really means "there is Abigail's range of doing it" and anybody who uses less as a means of improving the quality of the code, is guilty of limited thought. Sheesh.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://296885]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2017-02-22 04:35 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (324 votes). Check out past polls.