Re:Does OO really match the way we think (1997) [pdf]
by nonsince on Saturday August 12, 2017 @06:34AM
(#14997357)
Rust is neither OO nor FP, it's procedural (like C and Fortran) but borrows concepts from OO and FP. OO requires data structures to support dynamic dispatch, and although you can have dynamic dispatch in Rust via trait objects your code is heavily gimped - no generics, you can only pass by reference, lifetimes have to be explicitly annotated, etc. It feels like OOP-emulating C code from back in the day. Likewise, if you try to do pure functional programming in Rust you're going to have a bad time. Closures don't share types, and doing dynamic dispatch on them creates the same problems as trying to emulate OOP. In reality it's its own beast, much closer to C with templates than a crossbreed of C++ and Haskell.
[ Parent
| on HN ]
Re:Does OO really match the way we think (1997) [pdf]
by zaphar on Saturday August 12, 2017 @01:58PM
(#14999001)
I'm not sure where this meme on HN that Rust isn't OO comes from but it's based on a definition of OO that is almost never applied by day to day programmers and it's disagreed with by a fair number of language theory people.
Rust has encapsulation, message passing in the smalltalk/OO sense, and polymorphism. It does this through objects with attached methods, and traits. In every way that actually matters to a working programmer Rust is OO.
Re:Does OO really match the way we think (1997) [pdf]
by pjmlp on Saturday August 12, 2017 @09:49AM
(#14997876)
Contrary to mainstream knowledge there isn't one single truth of what OOP or FP actually are, rather multiple approaches of applying a set of abstract concepts.
Re:Does OO really match the way we think (1997) [pdf]
by boramalper on Saturday August 12, 2017 @10:13AM
(#14997942)
This, a million times. Any (meta) discussion on OOP without giving a precise definition of it is futile, for the devil lies precisely in those details that are omitted from the discussion.