News for hackers. Stuff that matters.
Re:The Case Against OOP Is Wildly Overstated by ghayes on Friday July 31, 2020 @02:32PM (#24012006)
For what it’s worth, with ADTs and non-exposed constructors you can achieve the same result (i.e. only the creating module can actually _build_ such a list but other modules can read the data).
Re:The Case Against OOP Is Wildly Overstated by zozbot234 on Friday July 31, 2020 @03:06PM (#24012569)
"Abstract data types and non-exposed constructors" is enough to give you object-based code, which is not too far from a definition of "the good parts" of OOP. Though some could quibble that "object-based" doesn't include sensible ideas such as composition, interface inheritance, delegation etc.
Re:The Case Against OOP Is Wildly Overstated by chriswarbo on Friday July 31, 2020 @03:42PM (#24013021)
Classes can be used as modules, as namespaces, as datatypes, for encapsulation, etc. The problem is they're not particularly great at those things, and those concerns often become conflated.
Re:The Case Against OOP Is Wildly Overstated by tsimionescu on Friday July 31, 2020 @02:55PM (#24012399)
Sure, there are usually equivalent mechanisms in all languages, because it is a good pattern. And yes, especially in OOP purism, it can also go over board, but there are absolutely use cases where tightly binding data and code is very useful (whether you do it with private members, ADTs, forward structure declaration, name mangling etc is less relevant, I think).