3 ms·
This article is just someone’s frustrated rant, poorly written. Definition of OOP has changed over the years, early on it was a lot of focus on inheritance & p
by fetbaffe 7y ago
This article is just someone’s frustrated rant, poorly written.
Definition of OOP has changed over the years, early on it was a lot of focus on inheritance & polymorphism, but today it is mostly about composition, which is basically what you do in FP as well.
New inventive ideas like Go's & Typescript's interfaces flips the relationship between the caller & the callee. Or Rust's traits where you can expand your existing types with new behavior.
There is criticism about OOP to be said, but using Java as your strawman to invalidate OOP is not really a good argument, it is just one implementation of many.
Edit: removed the word dynamically from description about Rust traits.
- 0815test 7y agoI'm not going to defend the article's writing style, but Rust is effectively a functional language with controlled use of procedural-programming features. Not that much different from how Haskell places safeguards on the very same things. (No, I'm not saying Rust today is just as safe or just as elegant as Haskell - far from it! But it can get there with some work.) Even FP is not what it was back in the 1980s and 1990s!
- fetbaffe 7y agoCan’t you make the argument that that part of Rust is OOP even though the rest of the language isn’t? Java has added more & more FP style constructs, does it make Java a FP language?
- millstone 7y agoWhat does functional language mean here? Rust is not referentially transparent, does not model effects (any function can rm -Rf your drive), permits shared mutable state (RefCell, etc) includes statements not just expressions (break, return). Its most important safeguard is its affine type system, which is absent from Haskell.
- steveklabnik 7y agoBreak and return are both expressions in Rust. Item declarations, let statements, expression statements, and macro invocation statements are the four kinds of statements in Rust.