On Wed, Jun 17, 2015 at 8:14 AM, Ehsan Akhgari <ehsan.akhg...@gmail.com>
wrote:

> On 2015-06-17 11:04 AM, Mike Hoye wrote:
>
>> On 2015-06-17 6:53 AM, Mike Hommey wrote:
>>
>>> So how about removing modelines and adding editorconfig files?
>>>
>>
>> I understand we're considering (or getting close to?) autoformatting
>> code on check-in.
>>
>
> Are we?  I'm curious to know more details about that...


Research shows that consistent code formatting increases readability, which
aids code comprehension and leads to fewer bugs. Furthermore, having
consistent style means machines can do the work of formatting and auditing
style, which means reviewers can focus more on what the code does, not its
cosmetics. The actual style isn't as important as the style being
consistent.

This is why organizations like Google and Facebook have established a
strong culture around consistent code formatting and have enabled machines
to do a lot of this work for them. See the Go programming language and its
gofmt tool, which goes a long way towards eliminating formatting pains.

I would strongly prefer for all Mozilla-authored code in mozilla-central to
follow a single code convention per language. Furthermore, this style
should be enforced through tools and formatting should largely be taken out
of the hands of humans and delegated to machines.

Yes, this means there will be epic bikesheds around establishing and
changing the style. But readability via consistency trumps that pain.

Can we all agree that the needs of the many outweigh the needs of the few
and establish a consistent and enforced C++ coding style across all of
mozilla-central? If so, perhaps we can find time in Whistler next week to
better integrate clang-format into the development workflow. I'd be more
than happy to help.

gps
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to