class A
{
public:
void Name(){}
}
class B
{
public:
void name(){}
}
C++, naming member functions
Some question about naming:
What do you think is better Name or name?
Problem is afaik in the book Designpatterns they use UpperCase notion, but in the stl they use lowercase.
What should i do? Is Stl naming the final truth?
Quote:Original post by Jonus
Problem is afaik Designpatterns use UpperCase notion and stl uses lowercase. What should i do?
Pick one or the other for yourself and use it consistently. Anything beyond that is a question of personal preference.
Quote:Original post by FrunyWhat do you prefer?Quote:Original post by Jonus
Problem is afaik Designpatterns use UpperCase notion and stl uses lowercase. What should i do?
Pick one or the other for yourself and use it consistently. Anything beyond that is a question of personal preference.
Quote:Original post by JonusThat you "pick one or the other for yourself and use it consistently." [wink] I personally prefer uppercase, if my opinion amounts to anything.Quote:Original post by FrunyWhat do you prefer?Quote:Original post by Jonus
Problem is afaik Designpatterns use UpperCase notion and stl uses lowercase. What should i do?
Pick one or the other for yourself and use it consistently. Anything beyond that is a question of personal preference.
Quote:Original post by Jonus
What do you prefer?
I generally use lower_case_with_underscores for members and reserve UpperCaseWords for class names.
I prefer to put a capital C in front of all my class names, and for function names I will have the first word in the function name be lower case and the rest of the words upper case. And for varibles I use an underscore between words and keep them all lower case.
class CEntity{ public: CEntity(); void thisIsAnExampleFunction(); private: int example_varible;};
Im with the camelCaseCrowd just for the record. But I tend to use UpperCase for free functions for stuff akin to generic/functional programming I go with the stl convention of using lowercase.
Maybe Im weird?
Maybe Im weird?
i use all upper case for class types, and all lower case for everything else:
class TEST{
void so_fuction;
};
TEST test;
class TEST{
void so_fuction;
};
TEST test;
Quote:Original post by CJWRMost ppl use all upper case for #defines.
i use all upper case for class types, and all lower case for everything else:
class TEST{
void so_fuction;
};
TEST test;
I use
UpperCamelCase for classes,
lower_case for structs, member and local variables and generic code,
and lowerCamelCase for private/protected functions,
and ALL_UPPER_CASE for non-local consts and #defines.
UpperCamelCase for classes,
lower_case for structs, member and local variables and generic code,
and lowerCamelCase for private/protected functions,
and ALL_UPPER_CASE for non-local consts and #defines.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement