You're missing the point: that example is completely useless without some idea of what the business requirements are.
If I were designing something like Microsoft Bob, then I wouldn't have a Dog class at all. There might be a class for the visual character in general, but behind that the different avatars (the dog, the dude, I don't remember what the other ones were) can just be data files with no code at all. If I were designing a video game, the dog might be built up of a rendering model plus a number of Components that handle different behaviors that get linked up with the dog (some of them might only ever be used with the dog, but some wouldn't). And if I were tracking pets in a database, the only distinction between a dog or some other animal would be a single column; again, no dedicated dog-specific code here.
An example in interface in Go and trait in Rust (not ideal for this argument, but at least simpler, less overhead than classes)
Really interesting that these two new languages have no classes.
You're missing the point: that example is completely useless without some idea of what the business requirements are.
If I were designing something like Microsoft Bob, then I wouldn't have a Dog class at all. There might be a class for the visual character in general, but behind that the different avatars (the dog, the dude, I don't remember what the other ones were) can just be data files with no code at all. If I were designing a video game, the dog might be built up of a rendering model plus a number of Components that handle different behaviors that get linked up with the dog (some of them might only ever be used with the dog, but some wouldn't). And if I were tracking pets in a database, the only distinction between a dog or some other animal would be a single column; again, no dedicated dog-specific code here.
Thanks for the comment.
I invite you not to get bogged down by my examples. I was just suggesting an alternative.
My point being when something is simple enough to maybe solve with functions, maybe there's no need to jump to writing classes from the get-go.
No one is suggesting classes are bad here.