I don't feel all that strongly about aFoo, but mFoo is incredibly important
for reviewing code when the reviewer isn't intimately familiar with the
code being changed (dom/ reviewers are a good example, because there's just
too much code to know by heart).

And if we accept mFoo, then the stylistic benefits of abolishing aFoo are
less compelling.

bholley

On Mon, Jul 6, 2015 at 8:26 PM, Mike Hommey <m...@glandium.org> wrote:

> On Mon, Jul 06, 2015 at 08:12:36PM -0700, Jeff Gilbert wrote:
> > I propose that we stop recommending the universal use of an 'a' prefix
> for
> > arguments to functions in C and C++. If the prefix helps with
> > disambiguation, that's fine. However, use of this prefix should not be
> > prescribed in general.
> >
> > `aFoo` does not provide any additional safety that I know of.[1] As a
> > superfluous prefix, it adds visual noise, reducing immediate readability
> of
> > all function declarations and subsequent usage of the variables within
> the
> > function definition.
> >
> > Notable works or style guides [2] which do not recommend `aFoo`: [3]
> > * Google
> > * Linux Kernel
> > * Bjarne Stroustrup
> > * GCC
> > * LLVM
> > * Java Style (Java, non-C)
> > * PEP 0008 (Python, non-C)
> > * FreeBSD
> > * Unreal Engine
> > * Unity3D (largely C#)
> > * Spidermonkey
> > * Daala
> > * RR
> > * Rust
> > * Folly (from Facebook)
> > * C++ STL entrypoints
> > * IDL for web specs on W3C and WhatWG
> > * etc.
> >
> > Notable works or style guides which *do* recommend `aFoo`:
> > * Mozilla (except for IDL, Java, and Python)
> > * ?
> >
> > 3rd-party projects in our tree which do not use `aFoo`:
> > * Cairo
> > * Skia
> > * ANGLE
> > * HarfBuzz
> > * ICU
> > * Chromium IPC
> > * everything under modules/ that isn't an nsFoo.c/cpp/h
> > * etc.?
> >
> > 3rd-party projects in our tree which *do* recommend `aFoo`:
> > * ?
> >
> > As far as I can tell, the entire industry disagrees with us (as well as a
> > number of our own projects), which means we should have a good reason or
> > two for making our choice. No such reason is detailed in the style guide.
> >
> > I propose we strike the `aFoo` recommendation from the Mozilla style
> guide.
>
> The existence of aFoo goes along with the existence of mFoo, sFoo, kFoo,
> and others I might have forgotten. Not that I particularly care about
> aFoo, but why strike this one and not the others?[1] It's not like they
> have widespread use in the industry either. That is, the same reasoning
> could be applied to them, yet, you're stopping at aFoo. Why?
>
> Mike
> _______________________________________________
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
>
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to