3 ms·
New to OOP programming. Could you explain what sort of arguments are presented against using OOP? I am genuinely curious.
by fermienrico 8y ago
New to OOP programming. Could you explain what sort of arguments are presented against using OOP? I am genuinely curious.
- hliyan 8y agoI've been programming for 15 years (so I was around for the rise of OOP). There's nothing fundamentally wrong with OOP. I still write a lot of classes. But what I haven't written in a almost a decade: code with inheritance, encapsulation or polymorphism. Nothing has exploded. Also, objects are best when used to represent actual objects (i.e. collections of data rather than collections of functions). This is OK User user = new User("John"); But this: StringTokenizer st = new StringTokenizer(str, ","); while (st.hasMoreElements()) { System.out.println(st.nextElement()); } Might not be as clean as: stdout(tokenize(str, ",")); // functions are hypothetical
- scarface74 8y agoI was about to reply in C# that would usually be done with LINQ, but then I realized I kind of just proved your point since LINQ is functional programming not OOP....
- _old_dude_ 8y agoThank you for posting this snippet of code, to me, it acts like the episode of the madeleine in the Swann's way. as you said, nowadays people are using String.split ``` List.of(str.split(",")) `` which is less poetic.
- theprotocol 8y agoExcellent examples. Minimalist OOP can be beautiful, but over-abstraction e.g. `FactoryObserverFactory` is absolutely disastrous.
- naasking 8y ago> Also, objects are best when used to represent actual objects (i.e. collections of data rather than collections of functions). Except these aren't objects, they're just records. I don't think it's a good idea to pollute the word "object" or OOP. You use objects specifically when you need procedural abstraction, otherwise you use other types of values, like products/records, sums/variants, etc. At high system levels, where you have client/server or other types of protocols, objects fit. At lower levels other paradigms tend to be better.
- u801e 8y ago> Also, objects are best when used to represent actual objects (i.e. collections of data rather than collections of functions). This reminds me of a certain blog post about Java flavored OOP[1] [1] https://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of-nouns.html https://steve-yegge.blogspot.com/2006/03/execution-in-kingdo...
- timbit42 8y agoThe best arguments against OOP, as it is done in most languages today, are made by Alan Kay, the creator of Smalltalk and the term "object-oriented". Alan should have used the term "message passing" so people wouldn't miss this component of Smalltalk that made it so great. "I invented the term object-oriented, and I can tell you that C++ wasn't what I had in mind." - Alan Kay, Source: https://youtube.com/watch?v=oKg1hTOQXoY&t=634s https://youtube.com/watch?v=oKg1hTOQXoY&t=634s
- hota_mazi 8y agoIt's not an argument against OOP, it's an attempt to redefine the term to be more in line with something that Kay invented. And the world has moved on. OOP is not about message passing.