You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@arrow.apache.org by Antoine Pitrou <so...@pitrou.net> on 2019/08/06 12:03:40 UTC
[Discuss] C++ filenames: hyphens or underscores?
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.
Re: [Discuss] C++ filenames: hyphens or underscores?
Posted by Wes McKinney <we...@gmail.com>.
I note that a change from underscores to hyphens would significantly
affect the Parquet, Plasma, and Gandiva libraries so I think we need
to hear from other developers of those subprojects. Underscores are
definitely less disruptive to the status quo
On Tue, Aug 6, 2019 at 4:18 PM Wes McKinney <we...@gmail.com> wrote:
>
> I have a slight gut preference for underscores but I am OK with
> changing everything to hyphens. The hyphens will probably grow on me
> as it means pressing the "shift" key less frequently. Is there any
> technical argument for using one over the other? My understanding is
> that `git blame` is pretty robust to renames
>
> On Tue, Aug 6, 2019 at 7:04 AM Antoine Pitrou <so...@pitrou.net> 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.
> >
> >
Re: [Discuss] C++ filenames: hyphens or underscores?
Posted by Wes McKinney <we...@gmail.com>.
I have a slight gut preference for underscores but I am OK with
changing everything to hyphens. The hyphens will probably grow on me
as it means pressing the "shift" key less frequently. Is there any
technical argument for using one over the other? My understanding is
that `git blame` is pretty robust to renames
On Tue, Aug 6, 2019 at 7:04 AM Antoine Pitrou <so...@pitrou.net> 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.
>
>
Re: Aw: Re: [Discuss] C++ filenames: hyphens or underscores?
Posted by Antoine Pitrou <an...@python.org>.
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.bothe@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" <pc...@gmail.com>
>> An: dev@arrow.apache.org, emkornfield@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 <em...@gmail.com>
>> 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 <
>>> fsaintjacques@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 <ko...@clear-code.com> 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 <20...@fsol>
>>>>> "[Discuss] C++ filenames: hyphens or underscores?" on Tue, 6 Aug 2019
>>>> 14:03:40 +0200,
>>>>> Antoine Pitrou <so...@pitrou.net> 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?
Posted by ha...@web.de.
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" <pc...@gmail.com>
> An: dev@arrow.apache.org, emkornfield@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 <em...@gmail.com>
> 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 <
> > fsaintjacques@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 <ko...@clear-code.com> 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 <20...@fsol>
> > > > "[Discuss] C++ filenames: hyphens or underscores?" on Tue, 6 Aug 2019
> > > 14:03:40 +0200,
> > > > Antoine Pitrou <so...@pitrou.net> 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.
> > > > >
> > > > >
> > >
> >
>
Re: [Discuss] C++ filenames: hyphens or underscores?
Posted by Philipp Moritz <pc...@gmail.com>.
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 <em...@gmail.com>
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 <
> fsaintjacques@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 <ko...@clear-code.com> 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 <20...@fsol>
> > > "[Discuss] C++ filenames: hyphens or underscores?" on Tue, 6 Aug 2019
> > 14:03:40 +0200,
> > > Antoine Pitrou <so...@pitrou.net> 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.
> > > >
> > > >
> >
>
Re: [Discuss] C++ filenames: hyphens or underscores?
Posted by Micah Kornfield <em...@gmail.com>.
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 <
fsaintjacques@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 <ko...@clear-code.com> 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 <20...@fsol>
> > "[Discuss] C++ filenames: hyphens or underscores?" on Tue, 6 Aug 2019
> 14:03:40 +0200,
> > Antoine Pitrou <so...@pitrou.net> 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.
> > >
> > >
>
Re: [Discuss] C++ filenames: hyphens or underscores?
Posted by Francois Saint-Jacques <fs...@gmail.com>.
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 <ko...@clear-code.com> 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 <20...@fsol>
> "[Discuss] C++ filenames: hyphens or underscores?" on Tue, 6 Aug 2019 14:03:40 +0200,
> Antoine Pitrou <so...@pitrou.net> 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.
> >
> >
Re: [Discuss] C++ filenames: hyphens or underscores?
Posted by Sutou Kouhei <ko...@clear-code.com>.
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 <20...@fsol>
"[Discuss] C++ filenames: hyphens or underscores?" on Tue, 6 Aug 2019 14:03:40 +0200,
Antoine Pitrou <so...@pitrou.net> 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.
>
>