On 09/07/2017 07:23 AM, Jean-Yves Avenard wrote:
On Thu, Sep 7, 2017 at 3:03 AM, Eric Rahm <er...@mozilla.com> wrote:
As I said, I was hoping to avoid rehashing this point, but the general
consensus from the last rather contentious post [1] was that changing from
the prevalent style of the codebase for primarily aesthetic reasons was
hard to justify (points about readability were made on both sides). Nick
pointed out that our code base very clearly tilts to the operators on the
end of the line style [2].

Seeing that the plan is after 57, to run clang-format on the entire
codebase (with the exclusions of 3rd party code).
Do we really need to care on what the current code mainly use?

Yes, we do. The clang-format configuration we use has for the most part been derived from the current Coding Style and the prevalent patterns existing in our code base. Where possible we have been modifying clang-format according to our needs. We have indeed upstreamed the Mozilla style to clang-format for this very reason: <http://clang.llvm.org/docs/ClangFormatStyleOptions.html>.

Post the switch to using clang-format tree-wide, our Coding Style for matters that clang-format can automate (such as whitespace formatting issues) will be simplified to "run clang-format". :-)

I don't think it matters, seeing that no matter what, the great
majority of the code will change, as nothing is following the current
coding style to the letter (with the exception of the majority of
dom/media)
The great majority of code changing is quite expected for any project switching to clang-format, since as it turns out automated tools are much better at doing this grunt work than humans are. The reason projects choose to switch to using clang-format is increasing developer productivity by allowing editor/IDE integration for formatting the code as you're editing it, ensuring the code formatting remains consistent over time without needing to spend invaluable engineering time on it, and being able to stop debating whitespace issues and moving on to focus on more productive discussions. ;-)

Still, picking styles that are not completely different with your existing code matters in the sense of reducing the pain of going through the blames when delving through the history of old code. To give you an extreme example, if we were hypothetically to pick tabs as indentation characters in lieu of spaces, that would basically guarantee touching almost every line of our code no matter what, whereas the current massive restyle of the code doesn't go anywhere close to being as drastic of a change.
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to