The OOP model fits nicely into most people’s heads because of the analogy to the real world and OOP implementations generally seem to give better signals when you are doing something wrong. Rather than functional implementations which mainly rely on human expert code reviewers and linters to give negative signals instead of say exception hierarchies.
A lot of the time you don’t realize your codebase is bad until “it’s just a button how hard can it be” somehow takes 3 months and 4 rollbacks.
At least this is what I have observed working on large codebases.
It also has been the default programing language paradigm for a while now, which I think explains why experienced programmers can cling to it despite its drawbacks. Try to teach object oriented programming to a beginner and it becomes clear that it isn't as natural as you are suggesting.
> generally seem to give better signals when you are doing something wrong.
Better than what? Functional programming is a far simpler abstraction: a function. Data in, data out. That's about as simple as it gets. Also, culturally, functional programmers generally understand the downside of distributed state, and actively try to minimize it. That's a good thing.
Bad code is bad code, but OOP gives you unique weapons to hurt yourself with. Inheritance allows one to change an unbounded number of objects without you even knowing. Modeling everything as a collection of objects with state tends to lead to programs that need to synchronize distributed state rather than a central state that is easier to keep consistent.
Js is still stateful everywhere, even where you don't want it to be
I’m not sure if you correctly understand what functional programming is.
Check out Grokking simplicity, great book.
Nothing in real world resembles OOP.
It's the same thing with languages, IMO. People try to shoehorn tasks into a language when it would be better off in another language.
What are its appropriate uses? The more I program the fewer I see.
Yeah, one of the 3 big lies of computer programming: thinking that we should program around a model of the world. We should program around a model of the data that we need to transform to solve whatever problem we need to solve. Even in simulation software like games.
A car have a motor which have pistons. But why would I model that? To be honest I’m not sure OOP is appropriate even for CAD software here. Now maybe we could give the user the ability to make a mesh and call that "piston", an let them copy & paste that mesh to build a super-mesh they would call "motor", but this kind of composition is not quite OOP, and the appropriate way to program this stuff is probably not OOP either.