Why avoid subtyping?

前端 未结 8 935
长发绾君心
长发绾君心 2020-12-02 07:55

I have seen many people in the Scala community advise on avoiding subtyping \"like a plague\". What are the various reasons against the use of subtyping? What are the altern

8条回答
  •  执笔经年
    2020-12-02 08:23

    This is the best paper I have found on the subject. A motivating quote from the paper –

    We argue that while some of the simpler aspects of object-oriented languages are compatible with ML, adding a full-fledged class-based object system to ML leads to an excessively complex type system and relatively little expressive gain

提交回复
热议问题