I am working on some legacy code and have come across something that I\'m not sure of. We have a class y
that is declared inside of another class x
.
I just went through code that I am updating (and I originally wrote) and removed all nested classes. Unfortunately, I originally used the nested class outside of the class it was defined in. Moving nested classes out made a huge difference to me because I originally had bad design.
If Y is only used in X and will never be used outside of X, I'd say keep it there