Rust dev, I enjoy reading and playing games, I also usually like to spend time with friends.

You can reach me on mastodon @sukhmel@mastodon.online or telegram @sukhmel@tg

  • 0 Posts
  • 91 Comments
Joined 1 year ago
cake
Cake day: July 3rd, 2023

help-circle






  • I mostly come to prefer composition, this approach apparently even has a wiki page. But that’s in part because I use Rust that forbids inheritance, and don’t have such bullshit (from delegation wiki page):

    class A {
        void foo() {
            // "this" also known under the names "current", "me" and "self" in other languages
            this.bar();
        }
    
        void bar() {
            print("a.bar");
        }
    }
    
    class B {
        private delegate A a; // delegation link
    
        public B(A a) {
            this.a = a;
        }
    
        void foo() {
            a.foo(); // call foo() on the a-instance
        }
    
        void bar() {
            print("b.bar");
        }
    }
    
    a = new A();
    b = new B(a); // establish delegation between two objects
    

    Calling b.foo() will result in b.bar being printed, since this refers to the original receiver object, b, within the context of a. The resulting ambiguity of this is referred to as object schizophrenia

    Translating the implicit this into an explicit parameter, the call (in B, with a a delegate) a.foo() translates to A.foo(b), using the type of a for method resolution, but the delegating object b for the this argument.

    Why would one substitute b as this when called from b.a is beyond me, seriously.








  • lad@programming.devtoMemes@lemmy.mlLost and found
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 month ago

    saying that the British should inherit it is a very weak argument

    Yes, I am not making that argument, inheritors mush be at least somewhat related.

    Although, in case you’re talking about, the indigenous people’s artifacts will likely end up in the country of their conquerors and oppressors, which is also a shame




  • lad@programming.devtoMemes@lemmy.mlLost and found
    link
    fedilink
    English
    arrow-up
    5
    ·
    edit-2
    1 month ago

    This is reasonable, but what if the culture that created the artifacts already went extinct like Maya? Besides, we’re not only talking about how it shouldn’t have been done in the past, but also about what to do today with that past.

    It’s easy to say that everything bad of today is only because of wrongdoings of yesterday, but it is not useful and usually is only used as propaganda for something that has no justification except for the past being bad.

    Edit: although, now that I think about it, coming from this viewpoint, that past is past and we should care about present, it’s clear that you’re right. If the culture bearer (or the inheritor, but this is grey zone for me) wants to destroy what is rightfully theirs, so be it. There is a bit of an issue with making those decisions by all eligible people, not a couple of extremists, though. Well, I think I found the contradiction that I had in me


  • lad@programming.devtoMemes@lemmy.mlLost and found
    link
    fedilink
    English
    arrow-up
    4
    ·
    1 month ago

    As far, as I know, there are many cases of not returning on the ground of owners not having conditions to preserve.

    But thanks for replying at least, I was hoping to see opposing opinions to try to understand what am I missing, not just ‘stealing bad’ downvotes