this post was submitted on 14 Mar 2024
138 points (96.6% liked)
Programming
17432 readers
179 users here now
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities !webdev@programming.dev
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Object oriented programming rose to popularity a few decades ago, along with a great deal of indoctrination and marketing for both the paradigm and related products. It was pushed so hard and so widely that more than a few folks grew into their developer roles assuming it was the best approach to every problem. Of course, it isn't.
(It definitely is useful at times, though, so please don't condemn it just because it's sometimes a square peg in a round hole.)
I'm glad to see you have discovered an alternative, and I hope you will continue to expand your toolbox and aim for simplicity.
People don't realize that OOP was pushed because some companies, like Sun microsystems, profited from its popularity.
Can you give an example of when oop is preferred to functional?
When it's easier to think about a system in terms of objects. The classic example is video game Entities/Game Objects. GUI stuff has also been very pleasant with OOP as buttons and the like are all easily conceptualized and worked with when seen as objects.
ECS is arguably a better for game dev, so even that point is debatable.
I think desktop GUI toolkits are a pretty good use case for object-oriented design, mainly because mapping window/widget families onto class hierarchies is straightforward.
That's not to say that a good functional design is impossible; it's just not particularly obvious.
One of the best use cases is implementing abstract data types and hiding the memory management and other potentially unsafe optimization tricks behind a clean and high level abstraction.
Also since it's a logical/mathematical construct and not attempting to model the real world (like business logic), it's one case where inheritance hierarchies will remain stable.
Wasn't there a video a while back of a presentation that OOP was created as a joke or something, and the person was surprised people were taking it seriously. Might have been advertised as the creator or OOP.
I took the video as a joke anyways, not a serious thing, but who knows. I don't even remember if it was OOP, or some other paradigm, or language, or who knows what else.
If anyone could find/link to it, I'd love to watch it again, but I'm having no luck; so my memory may be faulty.