Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Yegor Bugayenko
    @yegor256
    in real world a Dog definitely inherits many qualities from a Wolf
    and a Chair definitely inherits a lot from a Furniture Element
    JP
    @nqafield
    @yegor256 Do you see "qualities" as anything like "behaviour"? Could you say a dog does some of the same things as a wolf?
    Yegor Bugayenko
    @yegor256
    I guess..
    but David West says that the idea of a "class" is also wrong. it must not exist in OOP
    if we remove classes, we definitely won't have inheritance
    but then I don't know how everything will work :)
    JP
    @nqafield
    Are interfaces classes?
    Yegor Bugayenko
    @yegor256
    no, interfaces is a separate thing
    David said that classes were invented just to get rid of copy-paste problem
    but they should not exist in OOP, as concepts
    maybe that's why inheritance is a "bad" idea... I'm just thinking out loud
    SJTsai
    @SJTsai
    They're types, but you have to realize that an interface is simply a set of messages that can be sent
    Yegor Bugayenko
    @yegor256
    yeah, interfaces are types, I agree
    we can say that "Lucy" is a an object of type "Dog"
    type "Dog" requires everybody to be able to "walk()"
    "Lucy" walks this way: print "I am walking"
    so, there is no place for a class in this story so far
    we just say:
    Lucy = new {
      walk() { print "I am walking"; }
    }
    then, we want Max to be another dog, but a smarter one
    and we say:
    Max = new {
      walk() { print "I am walking"; }
      jump() { print "see, I can jump!"; }
    }
    even though there are obvious commonalities between Max's and Lucy's behavior, would be weird to say that Max "inherits" Lucy, right?
    Max is not a child of Lucy
    Yegor Bugayenko
    @yegor256
    my point is that "inheritance" in Java/C++ is a very technical concept, not really conceptual
    Max is not Lucy
    Silas Reinagel
    @SilasReinagel
    yes. it is a conceptual metaconcept
    we use it to categorize the world
    but the world does not exist that way
    Yegor Bugayenko
    @yegor256
    Max has nothing to do with Lucy
    JP
    @nqafield
    Yep @yegor256 . A "mechanism".
    Yegor Bugayenko
    @yegor256
    even though they "walk()" very similar
    Silas Reinagel
    @SilasReinagel
    More importantly, "Dog" is a broad concept, which becomes increasingly blurry at the edges
    JP
    @nqafield
    Similar traits? ;)
    Yegor Bugayenko
    @yegor256
    it looks like a Java tool, not an OOP concept
    am I right?
    I'm confused :)
    @pa9ey if it's just a mechanism, we can easily say that it is evil in OOP
    and just agree with Allen Holub and David West
    Glusk2
    @Glusk2
    @yegor256 Well in your example it's not conceptual... What about abstract class Animal with abstract method sound(). You could have Dogs, Birds, Giraffes, ... that implement sound() but are Animals at the same time.
    JP
    @nqafield
    Maybe. But don't we admit that OODD is the thing, and OOP is just a way of implementing OODD in our (currently) inadequate languages? @yegor256
    Hence, mechanism.
    Yegor Bugayenko
    @yegor256
    @pa9ey well, I'm trying to present OOP as a concept, not just a set of techniques
    as if there is some meaning behind all that classes, attributes, methods, etc.
    JP
    @nqafield
    But when you treat OOP as a concept, aren't you just talking about OODD? (I'm also just thinking out loud...)
    Yegor Bugayenko
    @yegor256
    I believe it's helpful, since the code will be better if it actually means something
    OODD means OO design and development?
    JP
    @nqafield
    Design and decomposition. (To borrow from David West.)
    Yegor Bugayenko
    @yegor256
    ah I see
    not really. I'm more about "OO paradigm"