Consider a naming convention that both method and type names
begin with capital letters. You define a container:
struct MyContainer {
//...
Iterator Begin();
Iterator End();
};
[Nothing to do with your question, but...]
More usual would be:
struct MyContainer
{
// ...
Iterator begin() ;
Iterator end() ;
} ;
One of the goals of a naming convention should be to distinguish
typenames from all other symbols.
If you have a generic function template designed to work with
standard containers,
If you have generic function templates designed to work with
containers, you haven't quite caught philosophy of the standard
library. Generic functions should be designed to work with
iterators. Where the names of the critical functions are *, ++
and ==; it's blatant abuse of operator overloading, but it does
avoid any argument about naming conventions.
it will expect the method names to be "begin" and "end", not
"Begin" and "End". To the extent that the actual and expected
names differ, the container and the function become
incompatible. The same holds for traits types, e.g. algorithm
implementations may need to know a container's value_type,
rather than its ValueType.
Certainly, when you want a name required by an external (to your
code) element, you conform to its requirements. The standard is
just one example; you don't call pthreadCreate, either.
I actually find this one (very small) advantage of camel case:
the reader knows immediately, from the way the name is formed,
whether the intent is to conform with some external convention
or not.
I'm not saying that any particular convention is superior to
any other, but that generic code is only as generic as the
naming conventions it expects. Expecting names to follow a
standardized convention is no different (AFAICS) from
expecting iterator types to support prefix increment and
dereference operations, or otherwise associating concepts with
syntax.
Exactly. The naming convention is part of the interface.
Without the interface requirements, you certainly wouldn't
overload ++ for an iterator, and without the interface
requirements, you might prefer the name ValueType, rather than
value_type.