Clear questions and runnable code
get the best and fastest answer
Re^5: Write code diferentlyby BrowserUk (Pope)
|on Aug 24, 2013 at 11:17 UTC||Need Help??|
Oh, BTW, just an additional quote from the Camel Book
I've no idea when that edition was revised; but if it was any time in the last 8 or so years, the revision was lacking.
I don't recall which version this was changed for; but it has been so for long enough that anyone leveling charges of "the inefficiency of map in a void context" can only be be cargo-culted repetition of something you've heard or read; not based upon actual experience.
Ie. Don't level a charge until you've tested it for yourself; rather than just parroting what you've heard or read others say.
And I upvoted your post despite a couple of things I don't like to much.
Don't! If you don't like what I say, don't upvote.
Now to those things you apparently didn't like:
And I was only trying to offer a possible reason why the OP asked the question in the first place.
Do you think that your guess as to his reasoning is likely to be any more definitive than my guess?
Yeah, I am more limited than you, sorry about that.
If you set out to be offended; you likely will be; but twisting my words to achieve that happy state is less rhetoric, more ....
I didn't say you were limited; I said your expectations were. And the latter is in no way a personal attack; just a statement of fact based upon your own expression of those expectations.
You expect to see map used to produce a new list from a list. This may be because you've come from a background (some other language; possibly a functional one) where that is the only way their (equivalent of) map can be used. Maybe because that is what you've read that it does. Or maybe it just the only way you've ever used it. None of these is an insult. None of these is a personal attack.
Perl's implementation of many widely used constructs is more flexible than their equivalents in other languages. That is in big part what makes Perl so useful and effective.
In this case, map embraces rather than decries the ability to modify the iterated list in place -- what you called a "side-effect" -- through the use of aliasing of the origin of the list. That allows Perl to achieve efficiencies that would be difficult (Haskell's unsafe* functions) or impossible (Clean/Miranda/Erlang) in other languages.
Labeling others' arguments does not make the label true. Besides, this is just rhetorics, falling short of a proper intellectual argument.
Dealt with above, but to reiterate.
If you repeat an idea without having tested it for yourself -- that's cargo-cult.
When the label applied is correct; that is perfectly good "intellectual argument". It's a fact.
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.