News for hackers. Stuff that matters.
Re:The Case Against OOP Is Wildly Overstated by MasonOfSpoons on Friday July 31, 2020 @02:02PM (#24011554)
It really isn't, as OOP languages don't traditionally provide robust mechanisms around immutability. And why would they? The core design of OOP is to wrap mutable state behind methods which control that mutation. OOP was in many ways a reaction to C; shared mutable structs are harmful, so let's invent privacy.

Most of the languages which are suggested to be superior alternatives to OOP in this thread have immutable data records and algebraic data types as core building blocks. These are very different than C-style structs, as they can provide stronger safety guarantees without a massive ream of boilerplate.

A class or method interface promises unfortunately little around essential topics like mutability, concurrency, or termination.

Re:The Case Against OOP Is Wildly Overstated by jayd16 on Friday July 31, 2020 @03:35PM (#24012934)
>The core design of OOP is to wrap mutable state behind methods which control that mutation.

That is the mechanism for immutability that is traditionally provided. It is easy to opt out of that protection.

Java and C# are getting records. They're a convenience but are in no way opposed or counter to OOP.

Re:The Case Against OOP Is Wildly Overstated by pjmlp on Friday July 31, 2020 @02:14PM (#24011717)
You can already do that via modules or fake modules in C translation units.

What OOP offers on top of modules is extendability and polymorphism.

And these two capabilities are possible to achieve in various ways.