isocpp / isocpp/CppCoreGuidelines
NL.n Use namespaces, do nest your namespaces. Do not use a suffix or prefix in all defined names to provide scope.
@BjarneStroustrup is already working on this.
Since Jun 19, 2017.
- Dominant language
- CSS
- Stars
- 45.3k
- Forks
- 5.6k
- PR merge metrics
- No merged PRs in 30d
Description
Reason:
Provides a narrow context where defined names are short, external names are well marked and also naturally segments your header-files, this makes larger code sets more easy to browse and comprehend and aids with refactoring.
Chances are your IDE provides a folding mechanism for namespaces, which is great when browsing these larger pieces of code.
Examples:
Alternatives:
Exceptions:
extern “C”
Enforcement:
Lint defined names and suggest shortening of long names, find repeated prefixes.
See also:
Notes:
Do not use reversed Internet domain names as namespaces, as java frequently do for package names.
Discussion:
Maybe GitHub could be persuaded to provide a global top-namespace allocatioin mechanism ?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.