byKey and byValue: properties or methods?
Michel Fortin
michel.fortin at michelf.com
Fri Jan 20 18:05:54 PST 2012
On 2012-01-21 01:43:17 +0000, Andrei Alexandrescu
<SeeWebsiteForEmail at erdani.org> said:
> On 1/20/12 7:31 PM, Michel Fortin wrote:
>> On 2012-01-20 17:58:28 +0000, Andrei Alexandrescu
>> <SeeWebsiteForEmail at erdani.org> said:
>>
>>> I tallied the votes.
>>>
>>> Function: Mail Mantis, bearophile, Jacob Carlborg, Olivier Pisano, Ary
>>> Manzana, torhu.
>>>
>>> Property: Nick Sabalausky, Simen Kjaeraas.
>>>
>>> I wasn't able to discern a clear vote from the others. Please correct
>>> the list.
>>
>> Votes ?!?
>>
>> I think byKey and byValue are oddly named, property or not.
>
> Give them better names and convince others. Please don't choose "keys"
> and "values".
Well, if the best ones are already taken, I'd say "allKeys" and
"allValues" would be the next best ones. And they are obviously
properties.
>> Since you
>> asked, I think they should be properties. But I don't care really. What
>> I care about is consistency.
>
> Mindless consistency would probably be unnerving too.
Guidelines are guides, not absolutes. If you have a good reason it is
perfectly fine to not follow the guideline, and you can amend the
document if it happens too often. But you need guidelines as a
baseline, and a good reason when you derogate.
>> Voting on a case by case basis is just nonsensical. What's needed are
>> guidelines and rationales covering how to name things and by extension
>> what should and shouldn't be a property. If something needs to be put to
>> vote, it should be those guidelines.
>>
>> I attempted a while ago to write some guidelines on the wiki, feel free
>> to use them if they make sense to you.
>> <http://prowiki.org/wiki4d/wiki.cgi?DProgrammingGuidelines>
>
> A good outcome of this vote might have been the distillation of some
> simple guidelines, as opposed to enforcing some arbitrary consistency.
> Apparently the participants in this thread are divided regarding
> general rules as well as their applicability to this particular case.
It'd be more useful if the discussion involved several examples of
various types. You can't make a guideline from only one case,
especially a litigious case. You must start by establishing a consensus
by listing more clear-cut cases and then you can extend from that
consensual position.
--
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/
More information about the Digitalmars-d
mailing list