I started to learn about inheritance and I was wondering where should I write the derived class. Should it be in the same .cs file as the base class or another .cs file? What is the consensus or norm about this? Does it even matter?
Personally, I almost always put my derived class in a different files. But, if you use inner class in your code, it's ok to be in the same file. The point is here, Single Responsibility Principle. By that;
Also check Multiple classes in a single .cs file - good or bad?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With