Or the font you use. In many fonts, an underscore tends to get
lost. If there are two heavy characters next to it
(alphanumeric, or heavy punctuation like a semi-colon, but not
period, comma or space), you still realize that it's there, but
it's often almost invisible otherwise.
The "old Unix-style" is nothing to separate words, and using a
maximum of abbreviations (especially dropping voyels).
Something like clltnbt
.
What about my_order?
Of course, with really good naming, you don't need anything; the
name contains enough semantic information so that it's obvious
whether it is a member (from the semantics). In practice, I've
found that most people (including myself) don't name that well,
and that the my_ prefix (or our_ for static members) is helpful
in many cases, enough to be worth standardizing on. (But I
admit exceptions: public data members, for example, don't
normally get it.)
CamelCase precedes Java by a long shot. It's almost universal
in the telecoms field, at least in Europe, and was long before
anyone had ever heard of Java. I tend to use it by habit, even
in my private code, because of my experience in telecoms.
Esthetically, I think I really prefer the underscore; it does
make for slightly longer names, but not that excessively, and it
looks more like what I would normally write (outside of a
programming context).
I disagree. The best would have been if there were some way of
enforcing good enough names so that the distinction wouldn't be
necessary. In practice, I find too that the real motivation for
the prefix/suffix is laziness: I'm too lazy to create
significantly different names for parameters and members in the
setters. (The real convention should probably be to "prefix"
both: my_state or my_current_state for the member, and
new_state for the parameter, or initial_state if it is a
parameter of a constructor. But as I said, I'm too lazy to do
this consistently.)