4 ms·
I don't really know about the others but Rust isn't really OO. Neither is Go.
by IshKebab 9y ago
I don't really know about the others but Rust isn't really OO. Neither is Go.
- pjmlp 9y agoSure they are, just not on the classical C++/Java style hence the footnote, as I was already expecting that kind of comments. There isn't "The ONE true OOP way", just like there isn't "The ONE true FP way" or "The ONE true LP way". Each paradigm has a set of concepts of what they might mean, and many languages cherry pick from there. Rust and Go implement polymorphism via traits and interfaces respectively. Rust and Go implement encapsulation via struct methods and modules. Rust and Go implement containment. Rust and Go allow for delegation. Rust allows for type extensions via a mix of generics and traits. Go allows for struct embedding as a kind of type extension. Class based inheritance is not a requirement for a language to be OO. CS literature is full of languages that explored other kinds of OO.
- lou1306 9y agoOn that topic, Joe Armstrong famously said that Erlang (Erlang!) might be the only "real" OOP language out there: after all, you can have encapsulation, polymorphism, delegation, and so on, by just designing appropriate exchanges of messages between processes.
- KayEss 9y agoI suggested many many years ago that Erlang was an OO language and of course the community ripped me to pieces for it :) I was very pleased to see him eventually come out on my side.