4 ms·
> You put it into a getters file and import it into the parent class. Almost every language has features for this Wait, what? So you can do this in C/C++ for
by jbenoit 3y ago
> You put it into a getters file and import it into the parent class. Almost every language has features for this
Wait, what?
So you can do this in C/C++ for sure. #include is not just for imports. But Java? C#? How!
- jaggederest 3y agoSuperclasses, interfaces, or module import. I'm no Java or C# expert but you have to lean into the conventions the language provides. I would probably have a separate small POJO that stores the configuration for the class if it had so many getters/setters I wanted to split them out.
- tgittos 3y agoC# at least supports the notion of partial classes that can have their definition spread over multiple files: https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/partial-classes-and-methods https://learn.microsoft.com/en-us/dotnet/csharp/programming-... Ruby has mixins and Python supports multiple inheritance. Go encourages composition over deep nested hierarchies. Many main stream languages support this kind of functionality.