Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re^7: For vs. Foreach

by BrowserUk (Pope)
on Feb 15, 2009 at 05:13 UTC ( #743913=note: print w/replies, xml ) Need Help??

in reply to Re^6: For vs. Foreach
in thread For vs. Foreach

Of course the C-style and csh-style forms are fundamentally different. No one was arguing against that.

The "obscure implementation distinction" to which I referred is one that javafan pointed out in Re^2: For vs. Foreach. Beyond that obscure, and as far as I can tell useless, implementation distinction, the keywords for & foreach are interchangeable, and can both be used to construct either form--C-style or csh-style--of loop.

Your unilateral decision to use the keyword for to refer exclusively to the C-style form, and foreach to refer to the csh-style form, (and to consider the alternate uses as "misspellings"), is arbitrary and capricious, and does not succeed in "keep[ing] it simple for people using the shorthand "for" vs "foreach".".

Given the prevalence of available code that uses either keyword for either form of loop, it will just further confuse things. Far better to just say it like it is, for & foreach are synonyms and either can be used to construct either of two forms of loop.

There is a good argument that the keywords should have been dedicated one to each of the two forms, along the lines which you favour, and were we at the point where that decision was being made, I would have backed you in that argument. But that time has long gone.

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.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2020-12-05 17:44 GMT
Find Nodes?
    Voting Booth?
    How often do you use taint mode?

    Results (65 votes). Check out past polls.