Mainly borrowed from google c++ style coding style
Lower case words seprated by underscores, and ends with an underscore, e.g. repos_list_
, context_menu_
Camel case starts with a "m", e.g. mUserNameText
, mServerAddr
Camel case, e.g. showRepos
- setter:
setRepoName()
- getter:
repoName()
Camel case starts with "k", e.g. :
const int kRepoRefreshInterval = 1000;
const char *kDefaultName = "seafile";
Use constants variables instead of macros to define constants.
- constant function parameter must be passed by object reference
- No
this->
when invoking member functions.
- no source file scope static variable/function, use anonymous namespace
- use forward declaration when possible, instead of including unnecessary header files
- Never use exceptions