PALISADE coding style is based on the official Google C++ coding style.
Of particular note on the documentation style:
- We use doxygen commenting style on classes, methods and constants.
- We given meaningful variable names to all variables.
- Every reused discrete block of code has its own method.
- Every discrete line or code or discrete group of code lines for each task has its own comment.
With regards to naming conventions:
- Variable names: camelCase
- Class, struct, typedef, and enum names: CamelCase
- Class data members: m_camelCase
- Class accessor names: GetProperty() and SetProperty()
- Class method names: CamelCase
- Global variable names: g_camelCase
- Constant names and macros: UPPER_CASE_WITH_UNDERSCORES (example: BIT_LENGTH)
- Operator overloading is allowed, especially for binary operations
We also follow these design principles:
- cout should never be used for exception handling and should never be used in committed code in the core PALISADE library.
- std::logic_error is the standard exception for all exceptions not caught by the PALISADE exception handling subsystem (which has not yet been universally implemented in the library at this time).