- We will follow the code formatting options provided by
clang-format
. Visit
the file .clang-format
for our settings.
- Classes, methods, and variables are all
snake_case
.
- Template parameters are
CamelCase
.
- Nothing is declared in the global namespace.
- No
new
/delete
; certainly no malloc()
or free()
.
- Use exceptions instead of error codes.
- Private members in classes are denoted as
member_
.
- Getters and setters should be
type myclass::member() const;
void myclass::member(const type&);
- Use
override
(and final
) wherever possible.
- Prefer brace initialization for classes.
- Use
auto
almost
always.
- Prefer fixed-width integer types.
- Use range-based for where possible.
- Use
nullptr
, never NULL
or 0, etc.
- Prefer
enum class
(strongly typed enum
s).
- Prefer no pointer over
unique_ptr
over shared_ptr
.
- Do not use
rand()
deprecated in
C++14.
- Use
#ifndef META_FILE_NAME_H_
for double inclusion guards.
#define
kept to a minimum, and ALL_CAPS_SNAKE if used.
- Lines should be no longer than 80 characters
- We will use Doxygen to document our
source.
- MeTA doxygen settings are in
meta.doxygen.in
.
- In general, the doxygen commenting style we will use is
/**
* Description if necessary. Otherwise can just be in the @return
* @param thing Capital first letter?
* @return lowercase for return?
*/
- In header files, include the brief LICENSE notice:
/**
* ...
*
* All files in META are dual-licensed under the MIT and NCSA licenses. For more
* details, consult the file LICENSE.mit and LICENSE.ncsa in the root of the
* project.
*/
- In the file comment, use
@file
and (preferrably) @author
. Of course,
multiple authors may be listed.
- All source files should be in
snake_case
- Binaries should be
hyphenated-file-names