• calcopiritus@lemmy.world
    link
    fedilink
    arrow-up
    4
    ·
    1 day ago

    But if I have to make an Array I have to inherit from Indexable which inherits from Collection which inherits from Object! How else am I supposed to implement an Array?

    • SparroHawc@lemmy.zip
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      40 minutes ago

      Admittedly this is why I like C#'s ‘implements’ paradigm. Doesn’t have to inherit, it just has to fulfill the contract, and then you can pass it to anything that expects the interface it implements. Keeps you from building giant trees.

    • mesa@piefed.social
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 day ago

      I remember some crazy stuff back when I had to work with a Java + ember.js project. Everything was like that.