Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



This was just as easy in the previous generation :)

OCaml has had this feature since 1996.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: