Changeset View
Changeset View
Standalone View
Standalone View
doc/developer-notes.md
Show First 20 Lines • Show All 87 Lines • ▼ Show 20 Lines | bool PerformTask(const std::string& s, int n) { | ||||
} else { | } else { | ||||
DoLess(); | DoLess(); | ||||
} | } | ||||
} | } | ||||
return didMore; | return didMore; | ||||
} | } | ||||
} | } | ||||
} | } // namespace foo | ||||
``` | ``` | ||||
Doxygen comments | Doxygen comments | ||||
----------------- | ----------------- | ||||
To facilitate the generation of documentation, use doxygen-compatible comment blocks for functions, methods and fields. | To facilitate the generation of documentation, use doxygen-compatible comment blocks for functions, methods and fields. | ||||
▲ Show 20 Lines • Show All 409 Lines • ▼ Show 20 Lines | - *Rationale*: `grep`:ing and auto-completing filenames is easier when using a consistent | ||||
naming pattern. Potential problems when building on case-insensitive filesystems are | naming pattern. Potential problems when building on case-insensitive filesystems are | ||||
avoided when using only lowercase characters in source code filenames. | avoided when using only lowercase characters in source code filenames. | ||||
- Don't import anything into the global namespace (`using namespace ...`). Use | - Don't import anything into the global namespace (`using namespace ...`). Use | ||||
fully specified types such as `std::string`. | fully specified types such as `std::string`. | ||||
- *Rationale*: Avoids symbol conflicts | - *Rationale*: Avoids symbol conflicts | ||||
- Terminate namespaces with a comment (`// namespace mynamespace`). The comment | |||||
should be placed on the same line as the brace closing the namespace, e.g. | |||||
```c++ | |||||
namespace mynamespace { | |||||
... | |||||
} // namespace mynamespace | |||||
namespace { | |||||
... | |||||
} // namespace | |||||
``` | |||||
- *Rationale*: Avoids confusion about the namespace context | |||||
Header Inclusions | Header Inclusions | ||||
----------------- | ----------------- | ||||
- Header inclusions should use angle brackets (`#include <>`). | - Header inclusions should use angle brackets (`#include <>`). | ||||
The include path should be relative to the `src` folder. | The include path should be relative to the `src` folder. | ||||
e.g.: `#include <qt/test/guiutiltests.h>` | e.g.: `#include <qt/test/guiutiltests.h>` | ||||
- Native C++ headers should be preferred over C compatibility headers. | - Native C++ headers should be preferred over C compatibility headers. | ||||
▲ Show 20 Lines • Show All 223 Lines • Show Last 20 Lines |