The Rise and Fall of Object Oriented Programming
1–10 of 29 posts
Re: The Rise and Fall of Object Oriented Programming
#2A lot of the current criticism of OOP targets aspects of the discipline that I don't think experienced programmers tend to use much anyway, like inheritance. I am just never compelled to create massive hierarchies, or even significant hierarchies.
Currently I'm even moving away from "encapsulation," finding the mindless creation of getter & setter methods to be wasteful academic tedium.
Re: The Rise and Fall of Object Oriented Programming
#3Re: The Rise and Fall of Object Oriented Programming
#4If the tide is turning against ORMs, it probably has a lot to do with the rising love for fp that this author covers. Languages like SQL are declarative, as is fp, so that approach feels more natural to people these days.
Re: The Rise and Fall of Object Oriented Programming
#5For instance, working with language like Kotlin or C# it's fairly straightforward to get the best of both worlds: Use inheritance where appropriate, favor composition in all other cases.
IMO being dogmatic about not wanting inheritance altogether will result in friction as well: The fact that Rust eschews inheritance altogether will increase boilerplate whenever you want to do something that is 'inheritance-like'. Sure, people will argue that in 90% of the cases this is bad design, but for the cases where it IS the best approach it's a shame it's not part of your toolbox.
Re: The Rise and Fall of Object Oriented Programming
#6I've always felt so alone in my distaste for ORMs. They often lead to at worst taking way more data than you need and manipulating it all in a language that's not very good at it, or at best running some kind of query-builder which takes a far more complex configuration to get the same data that a simple query could. Objects make much more sense as something to build from a query, not something to be queried themselv…
Re: The Rise and Fall of Object Oriented Programming
#7No, ease of testing is one of the reasons for OO adoption, and probably the primary reason software is much more stable than it was in the mid 90s.
> Many of those higher-level classes are “polluted” with methods and properties that are only relevant to a small number of subclasses.
Well, then it's broken and needs to be refactored.
> During my last couple years working at Google, I created a new user interface toolkit called “Quantum Wiz”
Of course, in true Google style, you wrote something from scratch instead of refactoring the old.
> composition > inheritance
Not a new finding. I learned this in 2000, at the peak of OO craze.
> Because object oriented inheritance is about organizing things into classes, it doesn’t model the real world very well; what it does model well is the way humans think about the real world.
That's the idea. Good software is written for the simplicity of those poor slobs charged with maintaining it -- often ourselves a year later.
> A physical object has many uses other than the specific purpose for which it was built. I can use a coffee cup as a paperweight or a doorstop;
The whole idea of modeling is to remove certain details! Otherwise the model would be identical to the genuine article, and would provide no benefit.
Re: The Rise and Fall of Object Oriented Programming
#8Isn't the argument that there is nothing inherently wrong with OOP but like all things, it shouldn't be used exclusively? For instance, working with language like Kotlin or C# it's fairly straightforward to get the best of both worlds: Use inheritance where appropriate, favor composition in all other cases. IMO being dogmatic about not wanting inheritance altogether will result in friction as well: The fact that Rust…
Re: The Rise and Fall of Object Oriented Programming
#9Luckily, the rising popularity of Swift, Kotlin, and Go, will push for a more reasonable use of OO in combination with FP.
Re: The Rise and Fall of Object Oriented Programming
#10> However, as the years went by, people started to realize that the strict approach to object orientation created a number of problems. These problems tended to be of the kind that makes code complex, hard to understand, and hard to test. No, ease of testing is one of the reasons for OO adoption, and probably the primary reason software is much more stable than it was in the mid 90s. > Many of those higher-level clas…
Refactoring means the original design didn't handle change well. Refactoring is badge of disgrace, and should not be considered a standard practice any more than putting out kitchen fires should be considered a standard practice of cooking. One of the key points of abstraction is to make the code change-friendly. If you have to refactor, the code failed that job. Minor rework is expected upon new requirements, but complete structural overhauls should be avoided, in part because it can create cascading side-effects.
Re: The whole idea of modeling is to remove certain details! Otherwise the model would be identical to the genuine article, and would provide no benefit.
But in some cases OO-based modelling becomes awkward or forced. Does the action of "gluing" belong with the glue or with the object being glued (fixed)? We can force it to be with one or the other to satisfy "OO rules", but that doesn't necessarily mean it's a good model. It's a forced model.
Re: [article] it doesn’t model the real world very well; what it does model well is the way humans think about the real world.
It doesn't model all thinking well. For smaller sub-systems it's fine. But OOP seems to get messy and tangled on a larger scale.