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;
};
usingstatements. If someone declaresusing System;then you don't need theSystem::prefix for any class declared inside of it.System::Monitorwould be preferred in that case.