Re: Aw: Re: [Discuss] C++ filenames: hyphens or underscores?

2019-08-07 Thread Antoine Pitrou


Some good points were made on the Arrow sync call.
To sum them up:

- looking through /usr/include on a Linux description, the vast majority
of filenames seem to user underscores, including in the C++ stdlib
- most our public C++ header files use underscores, so there's less
disruption to existing user code if we switch to underscores rather than
hyphens

So my current stance would be:
- switch to underscores for C++ source file names (*.h, *.cc files)
- ensure hyphens are used in executable file names (unit tests,
benchmarks, utilites) - perhaps using some CMake logic

Regards

Antoine.



Le 07/08/2019 à 11:19, hans-joachim.bo...@web.de a écrit :
> Hi,
> 
> I struggled long time if underscore or hyphen is better.
> The result was a mess, using both - never sure which one i actually used in a 
> certain case.
> 
> Today i am consistently using underscore in variable names and hyphens in 
> file names.
> - No more trial and error.
> - Compliant to Linux naming, as Kou rightly mentioned.
> - No chance to use hyphens in variable names - so i never forget which way it 
> is.
> 
> Hans
> 
> 
> 
>> Gesendet: Mittwoch, 07. August 2019 um 07:44 Uhr
>> Von: "Philipp Moritz" 
>> An: dev@arrow.apache.org, emkornfi...@gmail.com
>> Betreff: Re: [Discuss] C++ filenames: hyphens or underscores?
>>
>> I also have a small preference for underscores but would also be fine with
>> dashes.
>>
>> It seems to be more common (therefore blends better with vendored code) and
>> agrees with the styleguide and is closest to the exiting code. Also as an
>> aside, having file_names names like variable_names is nice. Compare the
>> Lispy way of using dashes for both.
>>
>> Thanks for getting this discussion started, the mixture of dashes and
>> underscores has been bothering me too :)
>>
>> On Tue, Aug 6, 2019 at 8:41 PM Micah Kornfield 
>> wrote:
>>
>>> I also have a preference for underscore but can get used to anything.
>>>
>>> I agree with the points François made above about the recommendation of the
>>> style guide and the smaller change to the existing code base.
>>>
>>> On Tue, Aug 6, 2019 at 6:52 PM Francois Saint-Jacques <
>>> fsaintjacq...@gmail.com> wrote:
>>>
 My vote would go with underscore to minimize changes and minimize
 exceptions to the google style guide reference. I also suggests that
 we add this to the linters somehow, if it's not too much trouble.

 François

 On Tue, Aug 6, 2019 at 9:35 PM Sutou Kouhei  wrote:
>
> Hi,
>
> I like hyphens.
>
> Because many Linux commands use hyphens than
> underscores. Here are counts on my Debian GNU/Linux machine:
>
> % ls /usr/bin/ | grep -- - | wc -l
> 956
> % ls /usr/bin/ | grep _ | wc -l
> 343
>
>
> Thanks,
> --
> kou
>
> In <20190806140340.2a7ffab2@fsol>
>   "[Discuss] C++ filenames: hyphens or underscores?" on Tue, 6 Aug 2019
 14:03:40 +0200,
>   Antoine Pitrou  wrote:
>
>>
>> Hello,
>>
>> The filenames in the C++ source tree are a bit ad hoc and
>>> inconsistent.
>> Sometimes they use hyphens for word separation, sometimes
>>> underscores.
>> In ARROW-4648 it was proposed that we unify C++ file naming,
>>> therefore
>> there are two possible options: only hyphens, or only underscores.
>>
>> What are your preferences?  Personally, I have a slight preference
>>> for
>> hyphens, especially as they are already used in binary names.
>>
>> Regards
>>
>> Antoine.
>>
>>

>>>
>>


Aw: Re: [Discuss] C++ filenames: hyphens or underscores?

2019-08-07 Thread hans-joachim . bothe
Hi,

I struggled long time if underscore or hyphen is better.
The result was a mess, using both - never sure which one i actually used in a 
certain case.

Today i am consistently using underscore in variable names and hyphens in file 
names.
- No more trial and error.
- Compliant to Linux naming, as Kou rightly mentioned.
- No chance to use hyphens in variable names - so i never forget which way it 
is.

Hans



> Gesendet: Mittwoch, 07. August 2019 um 07:44 Uhr
> Von: "Philipp Moritz" 
> An: dev@arrow.apache.org, emkornfi...@gmail.com
> Betreff: Re: [Discuss] C++ filenames: hyphens or underscores?
>
> I also have a small preference for underscores but would also be fine with
> dashes.
> 
> It seems to be more common (therefore blends better with vendored code) and
> agrees with the styleguide and is closest to the exiting code. Also as an
> aside, having file_names names like variable_names is nice. Compare the
> Lispy way of using dashes for both.
> 
> Thanks for getting this discussion started, the mixture of dashes and
> underscores has been bothering me too :)
> 
> On Tue, Aug 6, 2019 at 8:41 PM Micah Kornfield 
> wrote:
> 
> > I also have a preference for underscore but can get used to anything.
> >
> > I agree with the points François made above about the recommendation of the
> > style guide and the smaller change to the existing code base.
> >
> > On Tue, Aug 6, 2019 at 6:52 PM Francois Saint-Jacques <
> > fsaintjacq...@gmail.com> wrote:
> >
> > > My vote would go with underscore to minimize changes and minimize
> > > exceptions to the google style guide reference. I also suggests that
> > > we add this to the linters somehow, if it's not too much trouble.
> > >
> > > François
> > >
> > > On Tue, Aug 6, 2019 at 9:35 PM Sutou Kouhei  wrote:
> > > >
> > > > Hi,
> > > >
> > > > I like hyphens.
> > > >
> > > > Because many Linux commands use hyphens than
> > > > underscores. Here are counts on my Debian GNU/Linux machine:
> > > >
> > > > % ls /usr/bin/ | grep -- - | wc -l
> > > > 956
> > > > % ls /usr/bin/ | grep _ | wc -l
> > > > 343
> > > >
> > > >
> > > > Thanks,
> > > > --
> > > > kou
> > > >
> > > > In <20190806140340.2a7ffab2@fsol>
> > > >   "[Discuss] C++ filenames: hyphens or underscores?" on Tue, 6 Aug 2019
> > > 14:03:40 +0200,
> > > >   Antoine Pitrou  wrote:
> > > >
> > > > >
> > > > > Hello,
> > > > >
> > > > > The filenames in the C++ source tree are a bit ad hoc and
> > inconsistent.
> > > > > Sometimes they use hyphens for word separation, sometimes
> > underscores.
> > > > > In ARROW-4648 it was proposed that we unify C++ file naming,
> > therefore
> > > > > there are two possible options: only hyphens, or only underscores.
> > > > >
> > > > > What are your preferences?  Personally, I have a slight preference
> > for
> > > > > hyphens, especially as they are already used in binary names.
> > > > >
> > > > > Regards
> > > > >
> > > > > Antoine.
> > > > >
> > > > >
> > >
> >
>