this post was submitted on 30 May 2024
386 points (94.5% liked)

Programmer Humor

32483 readers
361 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[โ€“] CapeWearingAeroplane@sopuli.xyz 3 points 5 months ago (1 children)

Sounds reasonable to me: With what I've written I don't think I've ever been in a situation like the one you describe, with an algorithm split over several classes. I feel like a major point of OOP is that I can package the data and the methods that operate on it, in a single encapsulated package.

Whenever I've written in C, I've just ended up passing a bunch of structs and function pointers around, basically ending up doing "C with classes" all over again..

[โ€“] Theharpyeagle@lemmy.world 2 points 5 months ago

Indeed, I'd say an algorithm split among different objects is usually an indication of tightly coupled code. Every code pattern has its pitfalls for inexperienced devs, and I think tight coupling is OOP's biggest.