I've added the "tiny methods can be written in a single line" rule.
Search for "TinyFunction" and "LargerFunction" at
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#Classes
Nick
___
dev-platform mailing list
dev-platform@li
On 2014-05-29, 1:20 AM, L. David Baron wrote:
On Wednesday 2014-05-28 21:03 -0700, Nicholas Nethercote wrote:
static T inc(T& aPtr) { return IntrinsicAddSub::add(aPtr, 1); }
static T dec(T& aPtr) { return IntrinsicAddSub::sub(aPtr, 1); }
static T or_( T& aPtr, T aVal) { return __sync_fetch_an
On Wednesday 2014-05-28 21:03 -0700, Nicholas Nethercote wrote:
> > static T inc(T& aPtr) { return IntrinsicAddSub::add(aPtr, 1); }
> > static T dec(T& aPtr) { return IntrinsicAddSub::sub(aPtr, 1); }
>
> > static T or_( T& aPtr, T aVal) { return __sync_fetch_and_or(&aPtr, aVal); }
> > static T xor
On Wed, May 28, 2014 at 9:03 PM, Nicholas Nethercote wrote:
> Furthermore, one-liners like this are actually pretty common, and
> paving the cowpaths is often a good thing to do.
>
> Thoughts?
>
> Nick
>
+1. In a lot of cases, it seems pretty ridiculous to use 4 lines. See
things like the Owning
On Tue, Jan 7, 2014 at 12:53 PM, Robert O'Callahan wrote:
>
> We have a lot of places where we write "void Method() { ... }" all on one
> line for trivial setters and getters. I wonder if we should permit that.
The conclusion for this question was "no", but I will ask for it to be
reconsidered.
On 1/13/2014 2:33 PM, Milan Sreckovic wrote:
I didn't mean no inlining :), I was just talking about the format:
class A
{
public:
inline int hello {
return 4;
}
};
vs.
class A
{
public:
inline int hello();
};
inline int A::hello()
{
return 4;
}
We're pretty far from the origi
I didn't mean no inlining :), I was just talking about the format:
class A
{
public:
inline int hello {
return 4;
}
};
vs.
class A
{
public:
inline int hello();
};
inline int A::hello()
{
return 4;
}
--
- Milan
On 2014-01-09, at 16:21 , Ehsan Akhgari wrote:
> ...
>
>> As anothe
On 1/9/2014, 11:48 AM, Milan Sreckovic wrote:
if the goal of the styles is the readability, do we know that people actually care which
one of the described approaches we use, or is it also the "look, not all of these
things are the same" that offends us?
For example, I find the consistency of
On 2014-01-09, at 08:48, Milan Sreckovic wrote:
> For example, I find the consistency of the positioning of {} for the loops
> and conditionals extremely important for readability.
Outside of any real extremes, I’ve found that consistency is far more important
than any personal preferences.
if the goal of the styles is the readability, do we know that people actually
care which one of the described approaches we use, or is it also the "look, not
all of these things are the same" that offends us?
For example, I find the consistency of the positioning of {} for the loops and
conditi
On Wed, Jan 08, 2014 at 02:24:46PM -0500, Ehsan Akhgari wrote:
> On 1/7/2014, 7:00 PM, Cameron McCormack wrote:
> >Ehsan Akhgari wrote:
> >>Exactly. If we require braces on their own lines for function bodies
> >>everywhere, we wouldn't need to solve this!
> >
> >Are you sure? :) There are a bunch
On 1/7/2014, 7:00 PM, Cameron McCormack wrote:
Ehsan Akhgari wrote:
Exactly. If we require braces on their own lines for function bodies
everywhere, we wouldn't need to solve this!
Are you sure? :) There are a bunch of instances of
class A
{
A(int aMember)
: mMember(aMamber
Ehsan Akhgari wrote:
Exactly. If we require braces on their own lines for function bodies
everywhere, we wouldn't need to solve this!
Are you sure? :) There are a bunch of instances of
class A
{
A(int aMember)
: mMember(aMamber)
{}
};
through the tree. Depends how the "b
On 1/7/2014, 6:18 PM, Cameron McCormack wrote:
Benjamin Smedberg wrote:
1) Bracing of method bodies in a C++ class declaration
Currently, C++ method bodies inline within a class declaration are
documented to start on the next line, e.g.
class B
{
public:
void Method()
{
// Inline body brace is
Benjamin Smedberg wrote:
1) Bracing of method bodies in a C++ class declaration
Currently, C++ method bodies inline within a class declaration are
documented to start on the next line, e.g.
class B
{
public:
void Method()
{
// Inline body brace is on the next line, column 2
}
};
Mozilla code w
On 1/7/2014, 3:53 PM, Robert O'Callahan wrote:
I agree that those are the current best practices.
We have a lot of places where we write "void Method() { ... }" all on one
line for trivial setters and getters. I wonder if we should permit that.
I'd rather if we didn't. Often times changing th
I agree that those are the current best practices.
We have a lot of places where we write "void Method() { ... }" all on one
line for trivial setters and getters. I wonder if we should permit that.
We have a lot of places where the opening brace of a class declaration is
on the same line as the c
There are a few C++-isms which vary widely across the tree and I'd like
to clarify before we start any major refactorings.
1) Bracing of method bodies in a C++ class declaration
Currently, C++ method bodies inline within a class declaration are
documented to start on the next line, e.g.
clas
18 matches
Mail list logo