Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • 1
    Include+using namespace might be redundant, but it really does help with this. That seems like the right approach, but I'm not an experience C++ programmer. The usual warnings about using namespace only really apply when importing namespaces you don't control, where new API additions can cause breakages. Commented Sep 28, 2019 at 1:04
  • @Alexander That doesn't help with headers and spamming gigantic names in those, as using namespace should not be a thing in headers. Commented Sep 28, 2019 at 1:31
  • 2
    I think you can scope your using to a new scope, and put your header's contents within that Commented Sep 28, 2019 at 2:00
  • Good question, clearly about readability and the DRY principle, which are perfectly on-topic for this site. I have no idea why the question got a downvote. Commented Sep 28, 2019 at 7:45
  • 1
    @john01dav Dont think the namespace as some kind of file grouping mechanisms like folders. Consider them more as ways to modularize your code. Each namespace represents a module. Now if the module is kept in 1 single folder or is split across many folders is an implementation detail. To the consumer, it is just 1 module Commented Oct 4, 2019 at 7:21