|
Boost : |
From: Beman Dawes (beman_at_[hidden])
Date: 2000-07-13 08:58:04
Paul A. Bristow wrote:
>> boost seems to prefer all lower-case identifiers with underscores as
>> separators, so it's "half_pi" instead of "halfPi". Aliases (sqrtTwo
>> and rootTwo) should be avoided. The naming should be consistent
>> (gammaThird vs. thirdPi and sqrtE vs. eSqr). Probably define
>> an explicit naming policy so that others can add further constants
>> with a compatible naming.
>
>I am concerned that the use of _ within names will make them unacceptably
>long.
>oneDivSqrtTwoPi versus one_div_sqrt_two_pi.
>(Of course my preference is colored by my use of the mixed case style).
>But I willing to be guided if there are strong views on this.
We worked through this issue in detail, and over a long period of time, on
the C++ committee. The discussion was repeated, abet briefly, in early
boost postings. A short summary:
* Naming conventions are contentious, and although several are widely
used, no one style predominates.
* Given the intent to propose portions of boost for the next revision of
the C++ standard library, boost decided to follow the standard library's
conventions.
* Once a library settles on a particular convention, a vast majority of
stakeholders want that style to be consistently used.
* There is a strong preference for clear and descriptive names, even if
lengthy.
So please do follow the lowercase/underscore naming convention (with
uppercase macro names).
(Boost guidelines don't currently say anything about names. I'll add
something.)
--Beman
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk