Skip to main content
5 events
when toggle format what by license comment
Feb 17, 2022 at 14:41 comment added eclipz905 @Corrodias Note that issue only arises with the requirement that the rectangle be mutable. An ImmutableSquare can inherit from an ImmutableRectangle without issue.
Feb 16, 2022 at 19:01 comment added Corrodias I think the Liskov Substitution Principle is a good "theoretical" answer to this. Another way I've heard it phrased is, models of things don't have the same relationships with each other as real things do. Another example: a square is a rectangle, but a programming model of a square doesn't behave like the model of a rectangle. A rectangle has length and width that can be adjusted independently, but it doesn't make sense for a square to treat them as separate; they must always be equal. It has only one side-length.
Feb 16, 2022 at 15:19 comment added gnasher729 Drive-by downvoter hit us both :-) What a stupid boy.
S Feb 16, 2022 at 11:33 review First answers
Feb 16, 2022 at 14:36
S Feb 16, 2022 at 11:33 history answered hamilyon CC BY-SA 4.0