82
you are viewing a single comment's thread
view the rest of the comments
[-] Kache@lemm.ee 1 points 6 hours ago* (last edited 5 hours 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.

this post was submitted on 14 Nov 2024
82 points (95.6% liked)

Programmer Humor

19551 readers
494 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS