this post was submitted on 10 Feb 2026
313 points (95.6% liked)

Programmer Humor

30090 readers
1375 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
 
you are viewing a single comment's thread
view the rest of the comments
[–] tatterdemalion@programming.dev 77 points 2 weeks ago (16 children)

In over ten years of professional programming, I have never used inheritance without regretting it.

[–] Valmond@lemmy.dbzer0.com 4 points 2 weeks ago (6 children)

That's wild. What did you use it for?

[–] tatterdemalion@programming.dev 2 points 2 weeks ago (1 children)

Some legacy Python code that already used inheritance. I had to extend it, and it was pretty infeasible to refactor the whole thing to not use inheritance. Not sure if I technically regretted that decision, but it was definitely painful, since Python inheritance makes it really hard to follow program control flow.

[–] Valmond@lemmy.dbzer0.com 1 points 2 weeks ago (1 children)

Non typed inheritance, what could go wrong eh. You can just 'add' a function to a class dynamically in python, that is so bad.

Done any C++ classes & inheritance?

[–] tatterdemalion@programming.dev 1 points 2 weeks ago (1 children)

It was actually typed. Python had type annotations at the time.

I only wrote C++ very early in my career so I don't remember much, but I'm sure I at least tried some inheritance in toy games I would write. All of that code was trash though by my standards today.

[–] Valmond@lemmy.dbzer0.com 1 points 2 weeks ago (1 children)

Still does, but you don't have to.

So you haven't had much experience with oop?

[–] tatterdemalion@programming.dev 1 points 2 weeks ago (1 children)

I have used OOP design patterns many times, but that doesn't mean I use inheritance a lot. I almost always reach for interfaces instead.

[–] Valmond@lemmy.dbzer0.com 2 points 2 weeks ago

Well then I understand why inheritance isn't your thing, I yet have to see an interface in need of inheritance.

load more comments (4 replies)
load more comments (13 replies)