P
Phlip
Jonathan said:How about this one: member functions must have names with strictly
alternating uppercase and lowercase letters.
tHaT's NoT eStHeTiC.
Jonathan said:How about this one: member functions must have names with strictly
alternating uppercase and lowercase letters.
Derek said:The company where I work uses a naming convention that I have
never used before. They use mixed-case letters for public
member functions, but lower-case with underscores for the
rest, like this:
class Foo
{
public:
void somePublicMemberFunction();
protected:
void hello_i_am_protected();
private:
void this_one_is_private();
};
The other developers swear that this convention makes code
easier to understand, but not one of can give me a concrete
justification.
Incidentally, in my previous jobs I always used the same
convention for all member functions quite happily, but after
several months of using this new one I'm still not convinced
it adds value.
I understand that private *data* members deserve a trailing
underscore or m_ prefix to differentiate them from local
variables or function arguments, but the need for this
convention is not clear to me at all.
Anyone see the benefits?
Phlip said:that code duplicates no behavior?
Derek said:The other developers swear that this convention makes code
easier to understand, but not one of can give me a concrete
justification.
Derek said:My goal wasn't
to solicit a psychic reading; just to possibly hear from
someone who can offer an objective justification for this
peculiar naming scheme.
I can't see the benefit either. As for why they keep using
it, my theory is that it's a misguided convention (akin to
that used to differentiate access for data members) that
got used, gained critical mass, and now everyone keeps
doing it for no reason other than to keep the code looking
consistent.
Jonathan Turkanis said:How about this one: member functions must have names with strictly
alternating uppercase and lowercase letters.
Jonathan
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.