I don’t entirely subscribe to the first paragraph – I’ve never worked at a place so dear to me that spurred me to spend time thinking about its architecture (beyond the usual rants). Other than that, spot on

  • magic_lobster_party@kbin.run
    link
    fedilink
    arrow-up
    3
    ·
    edit-2
    7 months ago

    I’ve never regretted using composition (and thus having a few extra lines and a little bit more boilerplate) over inheritance.

    I second this. It doesn’t necessarily eliminate bad code, but it certainly makes it more manageable.

    Every time inheritance is used, it will almost certainly causes pain points that’s hard to revert. It leads to all these overly abstracted class hierarchies that give OOP a bad rep. And it can be easily avoided in almost all cases.

    Just use interfaces if you really need polymorphism. Often you don’t even need polymorphism at all.