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" <pcmor...@gmail.com> > 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 <emkornfi...@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 < > > 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 <k...@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 <20190806140340.2a7ffab2@fsol> > > > > "[Discuss] C++ filenames: hyphens or underscores?" on Tue, 6 Aug 2019 > > > 14:03:40 +0200, > > > > Antoine Pitrou <solip...@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. > > > > > > > > > > > > > > > >