[webkit-dev] When to use "auto"? (I usually consider it harmful)

Geoffrey Garen ggaren at apple.com
Tue Jan 7 11:07:19 PST 2014


>>> 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”?

For me, knowing that it’s a “DeconstructionPatternNode” tells me where to go in source code to find out more. Namely:

- Why do we need manual reference counting here? (Answer: DeconstructionPatternNode allocates variable-sized storage within itself, and aliases that storage as untyped memory.)

- Is this normal reference counting, or something weird? (Answer: DeconstructionPatternNode inherits from RefCounted<DeconstructionPatternNode>, so this is normal reference counting.)

Geoff
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-dev/attachments/20140107/856b0692/attachment.html>


More information about the webkit-dev mailing list