326
OOP at home: (feddit.nu)
you are viewing a single comment's thread
view the rest of the comments
[-] sip@programming.dev 3 points 1 day ago

composition can help with all of that. factories, strategies, injections are all composition patterns that work fine.

business logic that repeats? extract it to it's own thing (class, function, etc) and pass it as a param to the supposed childs.

mvc? controllers don't need to extend anything, just have them accept the framework through the constructor and request and response as args. views? same. models? perhaps only if doing an active record, but a repo pattern with plain objects is a good pattern too.

I never seen a clean inheritance implementation for a decently sized problem. it mostly works for tiny ones.

this post was submitted on 10 Feb 2026
326 points (95.8% liked)

Programmer Humor

29692 readers
1556 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 2 years ago
MODERATORS