Boost logo

Boost :

From: James Curran/MVP (jamescurran_at_[hidden])
Date: 2001-10-30 11:39:03


        My choice is to prefer words over numerals but, more
importantly, we should stick to one system consistently: If we leave
people wondering it it's two_pi or pi_2 and sqrt_2 or sqrt_two, the
constants won't be much use. Numerals might have more appeal to
non-English speakers but since everything else in C++ and the library is
firmly based on English, that's hardly a compelling argument.

        Further, I'd prefer full words with no abbreviations. The
rationale for this is that while there are many ways to abbreviate a
word, there is only one way of spelling it right. ("Is 'squareroot'
misspelled as 'sqrt' or 'sqroot' or 'sqr'?") C was intended to be terse
& easy to type. C++ tries to be explicit and easy to read
(reinterpret_cast?)

    Truth,
     James Curran

-----Original Message-----
        Message: 14
           Date: Mon, 29 Oct 2001 17:05:11 -0000
           From: "Paul A. Bristow" <boost_at_[hidden]>
        Subject: RE: Math constants - naming convention?

        I'm open to suggestions -
        but how about the following specifying by example and rationale:

        pi // prefer lower case only - use uppercase only for class
names.
        half_pi // prefer _ rather than halfPi (even though I prefer
this!)
        quarter_pi // rather than pi_div_4 - looks nicer


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk