|
Boost Users : |
Subject: Re: [Boost-users] Why something like #ifndef BOOST_MPI_HPP is alwayscapitalized?
From: Peng Yu (pengyu.ut_at_[hidden])
Date: 2008-09-19 16:30:18
Hi,
I'm wondering how you would handle the following case.
Suppose I have a set of mathematical formulas that has both bigger case and
lower case variables (such as both 'X' and 'x'). This situation is pretty
common. In order to implement them in C++, I could either write bigger cases
as well as lower cases in C++, which is not in consistence with the
convention that you mention. Or I have to convert bigger cases to lower
cases, which is also not easy to read, as it is different from the original
mathematical form.
Which approach would you prefer? I would prefer the former one. Therefore,
the convention is not followed.
Thanks,
Peng
On Fri, Sep 19, 2008 at 3:06 PM, Peter McGill <petermcgill_at_[hidden]> wrote:
> It is a standard C++ convention to capitalize #defines and constants like
> that.
> There is no technical reason, it just makes them easy to identify.
> Following common practice makes boost more accessible to many people.
>
> You should never have two header files which only differ in case.
> Some file systems (ie. dos/windows) do not allow files which only differ in
> case.
> Technical reasons aside, having two files which only differed in case would
> be
> potentially hard to understand. It is much clearer to give them different
> names.
>
> In both cases it is important to write understandable code, it is easier to
> maintain.
>
> Peter McGill
> IT Systems Analyst
> Gra Ham Energy Limited
>
> > -----Original Message-----
> > From: boost-users-bounces_at_[hidden]
> > [mailto:boost-users-bounces_at_[hidden]] On Behalf Of Peng Yu
> > Sent: September 19, 2008 3:47 PM
> > To: boost-users_at_[hidden]
> > Subject: [Boost-users] Why something like #ifndef
> > BOOST_MPI_HPP is alwayscapitalized?
> >
> > Hi,
> >
> > In most of the C++ header files I've seem, a macro like the
> > following is used to guard repetitive inclusion of the file.
> > I'm wondering why it is always in upper case. Why not make it
> > the same case as the file name?
> >
> > What if there are two header files on is in lower case, the
> > other is in upper case?
> >
> > Thanks,
> > Peng
> >
> > #ifndef BOOST_MPI_HPP
> >
> >
> >
>
>
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net