News for hackers. Stuff that matters.
Re:Goodbye, shitty Car extends Vehicle object-orientation tu... by hedora on Saturday June 25, 2022 @11:41AM (#31876133)
Modern OOP was introduced later. From what I can tell, the only new technical capability was implementation inheritance, which is strongly frowned upon these days.

Rust is a bit closer to the older OO ideal in that each object is its own private machine that encapsulates/protects its own state, and is late bound. The borrow checker allows the compiler to statically check that each use case of a given class is memory/threadsafe, and enforces basic state machines like "finish using this reference before calling next on the iterator", or "give up the ability to read() this network handle before transferring it to another thread". Modern OO completely fails to provide safety for those sorts of APIs (e.g. Java's ConcurrentModificationException is a compile time error in Rust)

On top of that base, you can build progressively more expressive OO-style API contracts, such as connection pools.

There are no comments on this comment yet.