• Kache@lemm.ee
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    7 days ago

    inheritance to avoid code duplication

    What no, inheritance is not for code sharing

    Sound bite aside, inheritance is a higher level concept. That it “shares code” is one of several effects.

    The simple, plain, decoupled way to share code is the humble function call, i.e. static method in certain langs.