Interface is one way to solve this entity problem. It provides an equally nice abstraction without carrying over lots of baggages. Also composition / mixin is a nice way. In non-OOP languages like Haskell or Erlang, problems can be solved mostly with functions and modules.
What I meant was if the problem's simple, there might not be a need in the first place for Dog to inheriting anything or to even be a Dog (with a capitalized D).
IMO It's better to be wary of writing classes than to jump to it as a first thought. You'd be surprised how meta it can feel to not having to strictly establish something as a definite being :)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Interface is one way to solve this entity problem. It provides an equally nice abstraction without carrying over lots of baggages. Also composition / mixin is a nice way. In non-OOP languages like Haskell or Erlang, problems can be solved mostly with functions and modules.
What I meant was if the problem's simple, there might not be a need in the first place for
Dog
to inheriting anything or to even be aDog
(with a capitalizedD
).IMO It's better to be wary of writing classes than to jump to it as a first thought. You'd be surprised how meta it can feel to not having to strictly establish something as a definite being :)