Skip to content

Comment on Is Go an Object-Oriented Language?parent

Comments

Inheritance is usually a mess because people use it to model objects when they should instead be modeling types: a triangle is not a shape, but a Shape is a sum type of Circle, Square, Triangle, etc.

Shape is definitely much more accurately modeled as an interface than a base class, since it has no functionality on its own.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.