Skip to content
Better HN
Top
New
Best
Ask
Show
Jobs
Search
⌘K
undefined | Better HN
0 points
noblethrasher
11y ago
0 comments
Share
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.
0 comments
default
newest
oldest
NateDad
11y ago
Shape is definitely much more accurately modeled as an interface than a base class, since it has no functionality on its own.
1 more reply
j
/
k
navigate · click thread line to collapse