[webkit-dev] When to use "auto"? (I usually consider it harmful)
Maciej Stachowiak
mjs at apple.com
Mon Jan 6 23:39:10 PST 2014
On Jan 6, 2014, at 3:34 PM, Darin Adler <darin at apple.com> wrote:
>
> On Jan 6, 2014, at 1:49 PM, Geoffrey Garen <ggaren at apple.com> wrote:
>
>> FunctionParameters::FunctionParameters(ParameterNode* firstParameter, unsigned size)
>> : m_size(size)
>> {
>> unsigned i = 0;
>> for (ParameterNode* parameter = firstParameter; parameter; parameter = parameter->nextParam()) {
>> auto pattern = parameter->pattern();
>> pattern->ref();
>> patterns()[i++] = pattern;
>> }
>> }
>>
>> If I had to describe this algorithm in English, I’d say, “Collect and retain all the [auto] from the list of parsed parameters.” I think that explanation would be stronger if “[auto]” were a concrete noun.
>
> The variable and the function are both named pattern and I would use that as the noun.
Question for Geoff or anyone who knows: is it contextually useful to know that it's specifically a "DeconstructionPatternNode*" beyond knowing that it's a "pattern"?
Regards,
Maciej
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-dev/attachments/20140106/9cd4ec8c/attachment.html>
More information about the webkit-dev
mailing list