Near the top of
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style
there is
> New code should try to conform to these standards, so it is as
> easy to maintain as existing code. [...]
>
> This article is particularly for those new to the Mozilla
> codebase [...]"  Before requesting a review, please read over
> this document, making sure that your code conforms to
> recommendations."
>
> Firefox code base uses the Google Coding style for C++ code [2]

On reading over the document, the reader finds a number of
additional guidelines, some of which are complementary or
orthogonal to Google style and some of which are contradictory.

Can we clarify which documents have precedence so that we can
spell this out clearly on this page, please?

"we would like to convert entirely to this [Google C++] coding
style -- perhaps with some exceptions for Mozilla-specific
constraints". [1]
Would the Mozilla coding style be the appropriate place to list
such exceptions?
The existing recording of a recent resolution [3] on this page
seems helpful to me.

The reason to think this page might not be the appropriate place
is because [1]
> we will retire the Mozilla C/C++ coding style.  The intention
> behind retiring the current Mozilla style is to just stop
> maintaining it as an active coding style going forward, but the
> documentation for this coding style will be kept intact.

What is the motivation for keeping intact the legacy coding style?
Is it to guide those contributing in code that has not yet moved
to Google style?  I wonder how useful that would be given "we now
have significant inconsistencies in the style of our codebase"
[1]?

If it is useful to keep intact the documentation of legacy style,
can we distinguish which are the guidelines that should apply only
to older code?

"we are not aiming to enforce any naming conventions at this time"
[1] but both the Google and Mozilla style guides have
(conflicting) naming conventions.  Can we clarify which, if any,
naming guidelines apply to new and older code?

The other piece of the equation here is [1]
> our precise coding style will be the result of formatting our
> tree with clang-format, so by definition our code, when
> formatted with clang-format, will be following our new coding
> style.

clang-format doesn't provide compliance with all guidelines in the
Google style, but it does have precedence, because the only option
to override is `// clang-format off`.  clang-format has its own
preferences for formatting, many of which are not documented in
the Google style guide.

Would it be appropriate for the Mozilla coding style page to
indicate that `./mach clang-format` defines the formatting of C++
code and the Google style guide provides other guidelines, which
should be followed in new code unless there is an exception
listed?

https://developer.mozilla.org/en-US/docs/Mozilla/Using_CXX_in_Mozilla_code
is another page with more guidelines.  I assume we would expect
these to be consistent with those on the Mozilla coding style
page.  I assume "Using C++ in Mozilla code" would take precedence
over Google style?

[1]
https://groups.google.com/forum/#!msg/mozilla.dev.platform/VCLB1Lz4yXc/dNoNVzmlCQAJ
[2]
https://google.github.io/styleguide/cppguide.html
[3]
https://groups.google.com/forum/#!topic/mozilla.dev.platform/0NFBXe6VnfM
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to