Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

10
  • 3
    One could temporarily accept that 0 is a valid numberOfWheels. However, eventually you might add a roll() method, at which point the subclass idea is looking prescient. Commented Jan 4, 2019 at 17:21
  • 11
    A boat has 0 wheels. What does that break? Commented Jan 4, 2019 at 18:51
  • 14
    @DDrmmr It's not that a Boat has 0 wheels, it that Wheels don't even exist as a concept for a Boat - hence your models shouldn't allow for it. Commented Jan 4, 2019 at 19:09
  • 10
    My point is that the example is bad. There is nothing conceptually wrong with a vehicle (that happens to be a boat) stating that it has 0 wheels. Commented Jan 4, 2019 at 19:50
  • 10
    Then it all goes to hell when you need to store a paddle boat. Commented Jan 5, 2019 at 2:04