4 ms·
Inheritance drives me nuts. I'm trying to read through a class and keep it all in my head, then I see a call that isn't defined, so I have to look at the base c
by kraftman 7y ago
Inheritance drives me nuts. I'm trying to read through a class and keep it all in my head, then I see a call that isn't defined, so I have to look at the base class. Now I have two classes I'm trying to keep in my head. But oh wait, it inherits from something else. Then I finally find the implementation and ive forgotten the context it was getting invoked in. I'd much rather just have an explicit import providing code reuse.
- hnick 7y agoAn IDE would help with this, at least for a strongly typed language ('go to definition'). For something like Perl, good luck! My other complaint is when the base class is updated independently of the child class. Suddenly your code is breaking because a new field is being set in the original function but not your override. For that reason I tend to inherit to extend only, as much as possible. I prefer to write a wrapper if it's a neater solution.
- crimsonalucard 7y agoDefinitely need an IDE for inheritance and OO heavy projects. It's not an apple and oranges thing, it's required.
- collyw 7y agoA decent IDE will help. I have found this site incredibly good for Django's class based views (which I struggles to understand before using it). https://ccbv.co.uk/ https://ccbv.co.uk/ I wish there was a way to auto generate something like this for all inherited code.
- tabtab 7y agoRe: I'd much rather just have an explicit import providing code reuse. I tend to agree. We need something closer to set theory to manage variations-on-a-theme rather than hierarchies: a buffet where one can pick and choose the parts as needed, and referencing groups of parts using group names to save time and provide abstraction/factoring. It's why I mentioned we need to get some inspiration from relational, which is heavily influenced by set theory.