News for hackers. Stuff that matters.
Re:Chris Lattner on the Realm WWDC 2017 Swift Panel by yiransheng on Saturday July 01, 2017 @02:07AM (#14675650)
Inheritance based OOP models tree-like entites well, where hirachy is defined and clear cut. Unfortunately, lots of real life domains are best expressed by graphs - commonly a DAG. You need to pay attention to your edges and not just the nodes. Inheritance based OOP gives you one keyword to express your edges: extend, and it's horribly inadequate. Mutatable state is not a issue in Java OOP, lacking the expressive power is.
Re:Chris Lattner on the Realm WWDC 2017 Swift Panel by willtim on Saturday July 01, 2017 @04:05AM (#14675968)
Trees can be modelled with sum types, the mathematical dual of product types (records). Java doesn't have sum types and so inheritance has to be used to encode them.