On 09/07/2017 11:16 AM, Emilio Cobos Álvarez wrote:
On 09/07/2017 04:01 PM, Andrew McCreight wrote:
I don't know if it rises to the level of something that should be in the
style guide, but I find the names very useful as a form of lightweight
documentation. Sure, if you are naming your Foo arguments aFoo the names
aren't useful, but for many widely used types like JSObject* and bool
knowing whether the argument is the global or something else is very useful.
Sure, wasn't intending to suggest that we should say "no named arguments
in declarations".
This is very context dependent, I'd never omit a name in a function that
takes (Element& aParent, Element& aChild), but it seems reasonable to
omit it in the case where there's no better name, like (InsertionKind
aInsertionKind) or (Element& aElement).
My question is mostly if this is something people find acceptable.
In some code I have seen people omit the name of arguments to document
that the callee will ignore the argument passed by the caller, such as
<https://searchfox.org/mozilla-central/rev/67f38de2443e6b613d874fcf4d2cd1f2fc3d5e97/dom/base/DOMRequest.h#59>.
I think this is probably an area where we want to leave things to
people's judgment.
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform