• calliope@retrolemmy.com
    link
    fedilink
    arrow-up
    14
    ·
    4 days ago

    I’m not announcing the death of object-oriented programming, I just liked the title. Yes, it’s effectively click-bait and I don’t apologise because I like it and because it is an explicit reference.

    An explicit reference to what?

  • 3abas@lemmy.world
    link
    fedilink
    arrow-up
    7
    ·
    4 days ago

    Now, it would be fair to say that the inheritance hierarchy here is badly designed, wrong, doesn’t actually make sense, and has nothing to do with object-oriented programming in the first place anyway. Also, wasting the 8 bytes of the width and height properties is meaningless in the grand scheme of things and thus the larger waste of time is thinking about this whole issue at a all. And maybe it is, but that is not a universal truth: this is engineering, and it is all about trade-offs. In a real-world inheritance hierarchy you’ll probably find that much more memory is being wasted, and the effect of it is not insigificant. At some point you’ll find that the cost of not thinking about this issue is too high to bear.

    Yet they couldn’t find a better example for their rant about how awful it is.

    I have found this blog post to be a waste of my morning time.

  • Ephera@lemmy.ml
    link
    fedilink
    English
    arrow-up
    5
    ·
    4 days ago

    Man, I haven’t done structural inheritance in years and by now, this reads like the ramblings of a mad person.

    Like, I recently had a use-case, where I actually wanted to define multiple types with the same fields and for various reasons ended up using a macro for that.
    And that still felt simpler than whatever is going on in this article, because there were no cross-relationships between the types at runtime. The macro templated the type definitions as if I had copy-pasted them, except there’s no actual code duplication, which is ultimately all I wanted.