On Fri, Apr 13, 2018 at 9:37 AM, Emilio Cobos Álvarez <[email protected]> wrote:
> Those changes I assume were generated with clang-format / clang-format-diff
> using the "Mozilla" coding style, so I'd rather ask people to agree in
> whether we prefer that style or other in order to change that if needed.
>
> Would people agree to use:
>
> , mIsRootDefined { false }
>
> Instead of:
>
> , mIsRootDefined{ false }
>
> What's people's opinion on that? Would people be fine with a more general
> "spaces around braces" rule? I can't think of a case right now where I
> personally wouldn't prefer it.
If we are going to have brace-initialization intermixed with
list-initialization (i.e. parentheses) in our codebase, I think we
should prefer no space prior to the brace, for consistency. If we are
going to switch wholesale (which would be a big job!)...I'd probably
say "no space", just on "that's the way we've always done it" grounds,
but can be convinced otherwise.
I agree with bz on disallowing braces in constructor init lists.
> Also, we should probably state that consistency is preferred (I assume we
> generally agree on that), so in this case braces probably weren't even
> needed, or everything should've switched to them.
Indeed.
> Finally, while I'm here, regarding default member initialization, what's
> preferred?
>
> uint32_t* mFoo = nullptr;
>
> Or:
>
> uint32_t* mFoo { nullptr };
I lean towards the former here. I think the former is more common in
the code I've seen, but apparently the latter is "preferred C++" or
something?
-Nathan
_______________________________________________
dev-platform mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-platform