On 02/16/2017 08:05 PM, smaug wrote:
On 02/16/2017 07:24 PM, Henri Sivonen wrote:
It seems that we already have MFBT code that has lower case methods
begin/end/cbegin/cend, etc., for compatibility with C++ standard
library iteration:
https://dxr.mozilla.org/mozilla-central/source/mfbt/ReverseIterator.h#136
I guess these methods shouldn't be capitalized, then.
It seems that even size() and empty() should be lower-case if one
wants a type to quack like a Container:
http://en.cppreference.com/w/cpp/concept/Container
Should these, too, no longer be capitalized?
If a containerish type has more methods that are uncapitalized for the
above reasons than methods whose names aren't constrained by standard
interop, should the remaining methods follow Mozilla naming or
standard library naming?
AFAIK, uncapitalized method names in MFBT are the old style, and new code
should just
use Mozilla coding style.
This was discussed in some other thread in dev.platform, but I can't find it
right now.
It was in the thread about mozilla::Result
From njn:
> It was once a mess, but is not any more. MFBT has for some time used
>standard Mozilla style, with the following minor exception described in
> mfbt/STYLE:
>
>- Some of the files use a lower-case letter at the start of function names.
> This is because MFBT used to use a different style, and was later
> converted
> to standard Mozilla style. These functions have not been changed to use an
> upper-case letter because it would cause a lot of churn in other parts of
> the
> codebase. However, new files should follow standard Mozilla style and use
> an
> upper-case letter at the start of function names.
>
>- Imported third-party code (such as decimal/*, double-conversion/*, and
> lz4*)
> remains in its original style.
-Olli
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform