I'm obsessed with organization - it's probably the real reason why I enjoy coding. So I namespace everything. But I'm just curious if I'm doing it wrong by being redundant.
Consider this, which I think is correct
namespace System {
class File {};
class Monitor {};
class Logger {};
}
Now consider this, which is what I seem to be doing
namespace System {
class SystemFile {};
class SystemMonitor {};
class SystemLogger {};
}
Am I being redundant? It's just that, SystemFile
is a file in the system. SystemMonitor
monitors the system.
In use cases, which would you prefer?
class Application {
public:
System::Monitor monitor;
// or
System::SystemMonitor monitor;
};
using
statements. If someone declaresusing System;
then you don't need theSystem::
prefix for any class declared inside of it. – Berin Loritsch Jan 24 '20 at 19:13using
thankfully – errno_44 Jan 24 '20 at 19:14System::Monitor
would be preferred in that case. – Berin Loritsch Jan 24 '20 at 19:36