[prev in list] [next in list] [prev in thread] [next in thread]
List: perl5-porters
Subject: Re: Variable naming (was: Re: Maybe it's time to disallow two variables with the same name and diffe
From: Branislav_ZahradnĂk <happy.barney () gmail ! com>
Date: 2024-01-03 11:25:16
Message-ID: CAB=rbOng7E6qhzA5mHDQY_EuemKuSEK-xqu3+9p=cu=sncKVjQ () mail ! gmail ! com
[Download RAW message or body]
>
> Saying "foreach person in people" reads better than "foreach person in
> person",
> doesn't it? The latter seems rather confusing or nonsensical.
>
>
.. and here I'm where I don't know how to express myself :-) Let's try:
you should not specify "in person" or "in people" at all. You should be
describing quality of persons
you want to iterate over.
Going back to cities (pseudocode):
foreach city { }
foreach regional_capital (country == France)
Regarding plural:
Iterators, generators, lookups - all of them may be plural.
>
> For these hashes it is NEITHER plural nor singular, rather the name should
> reflect the relationship.
>
With small modification this is probably best description: "For collections
..."
[Attachment #3 (text/html)]
<div dir="ltr"><br><div class="gmail_quote"><blockquote class="gmail_quote" \
style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"> <br>
Saying "foreach person in people" reads better than "foreach person in \
person", <br> doesn't it? The latter seems rather confusing or \
nonsensical.<br> <br></blockquote><div><br></div><div>.. and here I'm where I \
don't know how to express myself :-) Let's try:</div><div><br></div><div>you \
should not specify "in person" or "in people" at all. You should \
be describing quality of persons</div><div>you want to iterate \
over.<br></div><div><br></div><div>Going back to cities \
(pseudocode):</div><div></div><div><br></div><div>foreach city { }</div><div>foreach \
regional_capital (country == France)<br></div><div><br></div><div>Regarding \
plural:<br></div><div><div>Iterators, generators, lookups - all of them may be \
plural.<br></div><div></div> <br></div><blockquote class="gmail_quote" \
style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"> <br>
For these hashes it is NEITHER plural nor singular, rather the name should <br>
reflect the relationship.<br></blockquote><div><br></div><div>With small modification \
this is probably best description: "For collections \
..."</div><div><br></div><br></div></div>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic