Date: 2001-03-17 09:55:27
--- In boost_at_y..., "David Abrahams" <abrahams_at_m...> wrote:
> ----- Original Message -----
> From: "Beman Dawes" <bdawes_at_a...>
> > >...and keeping in mind that names beginning with underscores are
> > >to the implementation in the global namespace (18.104.22.168.2)...
> > Yes. My comment applied only to member names, which was the
> > original question.
> I realize that. Call me superstitious, but I get nervous around
names I have
> to remember not to use in certain contexts. Sort of like the sailor
> use with your drinkin' buddies but will get you thrown in the brig
That's precisely why I thought I'd entertain comments. There are
five styles I've seen used, each rubs me wrong for different reasons:
m_name: This makes the variable name longer and harder to read to me,
even though coming from the MS world I'm very used to it. I just
don't like the embedded underscore here. This is awfully nit picky,
yes, so when I do use warts this is often the one I use.
mname: Fully unreadable.
mName: Readable, but I prefer not using mix case, which I believe was
mentioned in the Boost guidelines as well, though I could be
remembering this wrong.
_name: As Dave pointed out this is only safe in the context of class
variables. Granted, that's precisely what the wart is supposed to
indicate, but it still feels wrong to use a wart that's restricted in
name_: Don't know why, but this one really bugs me. It looks like
someone just didn't finish typing out the variable name here.
None of these are valid reasons to not use them (or any other wart
for that matter), it just shows why I've had problems settling on one
that I care to use. If Boost developers used one consistently (or at
least almost so) than I'd be able to put aside my aversions and just
use them, defering to someone else's opinion. But since it's fully
an individual's preference, I don't like any of them ;).
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk