3 ms·
I also went through the stages of using classes with inheritance, and then using plain functions on untyped Plain-old-Data objects. There's a third stage, thou
by derefr 13y ago
I also went through the stages of using classes with inheritance, and then using plain functions on untyped Plain-old-Data objects.
There's a third stage, though: using classes without inheritance, but with interface/protocol declarations. This is made much easier in the latest generation of languages (Go, Rust, Elixir) that infer the interfaces/protocols which a given piece of data supports, allowing you to use interfaces/protocols without classes.
- Arkadir 13y agoThis was just as easy in the previous generation :) OCaml has had this feature since 1996.