You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mesos.apache.org by Kapil Arya <ka...@mesosphere.io> on 2015/02/20 21:20:25 UTC

Mesos style question about blank lines

What is the preferred amount of blank lines before the first function
definition inside a namespace? I have a seen single blank line as well as
two blank lines in our code base.

For example, in the following snippet from a cpp file, how many blank lines
should be inserted at A1, A2 and B?

namespace mesos {
        <- A1. Single blank line or two?
using mesos::slave::Flags;
        <- A2. Single blank line or two?
void foo()
{
}


void bar ()
{
}
        <- B. Single blank line or two?
} // namespace mesos {


Kapil

Re: Mesos style question about blank lines

Posted by Vinod Kone <vi...@gmail.com>.
Sure thing. 

@vinodkone

> On Feb 20, 2015, at 12:45 PM, Kapil Arya <ka...@mesosphere.io> wrote:
> 
> Thanks Vinod! This is clear now. Should we also add this to mesos-style
> guide?  I can create a RR.
> 
>> On Fri, Feb 20, 2015 at 3:23 PM, Vinod Kone <vi...@apache.org> wrote:
>> 
>> A1 - Single
>> A2 - Double
>> B - Single
>> 
>>> On Fri, Feb 20, 2015 at 12:20 PM, Kapil Arya <ka...@mesosphere.io> wrote:
>>> 
>>> What is the preferred amount of blank lines before the first function
>>> definition inside a namespace? I have a seen single blank line as well as
>>> two blank lines in our code base.
>>> 
>>> For example, in the following snippet from a cpp file, how many blank
>> lines
>>> should be inserted at A1, A2 and B?
>>> 
>>> namespace mesos {
>>>        <- A1. Single blank line or two?
>>> using mesos::slave::Flags;
>>>        <- A2. Single blank line or two?
>>> void foo()
>>> {
>>> }
>>> 
>>> 
>>> void bar ()
>>> {
>>> }
>>>        <- B. Single blank line or two?
>>> } // namespace mesos {
>>> 
>>> 
>>> Kapil
>> 

Re: Mesos style question about blank lines

Posted by Kapil Arya <ka...@mesosphere.io>.
Thanks Vinod! This is clear now. Should we also add this to mesos-style
guide?  I can create a RR.

On Fri, Feb 20, 2015 at 3:23 PM, Vinod Kone <vi...@apache.org> wrote:

> A1 - Single
> A2 - Double
> B - Single
>
> On Fri, Feb 20, 2015 at 12:20 PM, Kapil Arya <ka...@mesosphere.io> wrote:
>
> > What is the preferred amount of blank lines before the first function
> > definition inside a namespace? I have a seen single blank line as well as
> > two blank lines in our code base.
> >
> > For example, in the following snippet from a cpp file, how many blank
> lines
> > should be inserted at A1, A2 and B?
> >
> > namespace mesos {
> >         <- A1. Single blank line or two?
> > using mesos::slave::Flags;
> >         <- A2. Single blank line or two?
> > void foo()
> > {
> > }
> >
> >
> > void bar ()
> > {
> > }
> >         <- B. Single blank line or two?
> > } // namespace mesos {
> >
> >
> > Kapil
> >
>

Re: Mesos style question about blank lines

Posted by Vinod Kone <vi...@apache.org>.
A1 - Single
A2 - Double
B - Single

On Fri, Feb 20, 2015 at 12:20 PM, Kapil Arya <ka...@mesosphere.io> wrote:

> What is the preferred amount of blank lines before the first function
> definition inside a namespace? I have a seen single blank line as well as
> two blank lines in our code base.
>
> For example, in the following snippet from a cpp file, how many blank lines
> should be inserted at A1, A2 and B?
>
> namespace mesos {
>         <- A1. Single blank line or two?
> using mesos::slave::Flags;
>         <- A2. Single blank line or two?
> void foo()
> {
> }
>
>
> void bar ()
> {
> }
>         <- B. Single blank line or two?
> } // namespace mesos {
>
>
> Kapil
>