Note The names of variables and data members are all lowercase, with underscores between words. Data members of classes (but not structs) additionally have trailing underscores. For instance:
a_local_variable
,a_struct_data_member
,a_class_data_member_
.
double mean_area; // OK - uses underscore.
double meanarea; // OK - all lowercase.
double meanArea; // Bad - mixed case.
Private data members of classes or structs, both static and non-static, are named like ordinary non-member variables, but with a trailing underscore.
class ElementBase {
...
private:
double mean_area_; // OK - underscore at end.
double meanarea_; // OK.
std::vector<std::shared_ptr<Nodes>> vec_nodes_; // OK.
};
There are no special requirements for global variables, which should be rare in any case. If your code requires a global variable, consider prefixing it with g_ and define it as a const
inside a namespace.
Constants should be named with all capitals and underscores.
const double PI = 3.1415926535897;