CodeStyle » History » Version 1
Junxiao Shi, 01/18/2014 09:56 PM
1 | 1 | Junxiao Shi | # NFD code style guidelines |
---|---|---|---|
2 | |||
3 | NFD adopts [NDN Platform C++, C, C#, Java and JavaScript Code Guidelines](http://named-data.net/codebase/platform/documentation/ndn-platform-development-guidelines/cpp-code-guidelines/), with the following exceptions: |
||
4 | |||
5 | * (amended 10). Global variables should have `g_` prefix |
||
6 | * (amended 11). **All** class variables should have `m_` prefix. Static class variables should have `s_` prefix. |
||
7 | * (amended 33). We will use only `.cpp` and `.hpp` extensions |
||
8 | * (amended 44). Avoid C-style casts. Use `static_cast`, `dynamic_cast`, `reinterpret_cast`, `const_cast` where appropriate instead. |
||
9 | * (new). Exceptions can be used in the code, but should be used only in **exceptional** cases and not in the primary processing path. |
||
10 | * (new). When declaring/defining function/method, the return type should be put on a separate line before function/method name. |