324
OOP at home: (lemmy.nz)
you are viewing a single comment's thread
view the rest of the comments
[-] mesamunefire@piefed.social 43 points 8 months ago

Its the best/worst thing about OOP no matter what language.

We had a rule at work that if you are 3 levels or more down an inheritance tree, then you are too far. The cognitive load is just too much, plus everything stops making sense.

One level can be great (MVC all have great conventions, MCP as well). Two can be pushing it (Strategy pattern when you have physical devices and cant be connected all the time, Certain kinds of business logic that repeat hundreds of times, etc...) But even there you are kinda pushing it.

I need code that I can look at a month from now and know WTF is happening. And sometimes its better to have less DRY and more comprehension. Or maybe im just a forever mediocre dev and dont see the "light". I dunno.

[-] firelizzard@programming.dev 7 points 8 months ago

When I first started using Go I bemoaned the lack of true inheritance and classes. Now I love it.

[-] Not_mikey@lemmy.dbzer0.com 1 points 8 months ago

I thought it didn't have classes in name only, isn't a struct with methods basically a class?

[-] firelizzard@programming.dev 3 points 8 months ago

Depends on what you mean by “basically a class”. If you mean inheritance, overriding, and more generally class/inheritance based polymorphism, no, it does not. Those require dynamic dispatch, which Go does not have (for concrete types, which is what we’re talking about here).

load more comments (1 replies)
load more comments (1 replies)
load more comments (17 replies)
this post was submitted on 10 Feb 2026
324 points (95.5% liked)

Programmer Humor

33631 readers
2464 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 3 years ago
MODERATORS