3 ms·
IMO the easiest way to poke a hole in the argument is to say: ok, now what happens when you want to add the coach of the team? and the owner? Adding them to the
by rmrfrmrf 13y ago
IMO the easiest way to poke a hole in the argument is to say: ok, now what happens when you want to add the coach of the team? and the owner? Adding them to the Players list would be problematic considering they're not really players. If you tried to rig it anyway, your Count method would return incorrectly, and you'd have to override it to exclude coaches. While we're at it, where are you storing the team's name? A variable name alone isn't going to help you display that info to the end-user.
Granted, none of this matters if the OP's problem domain stays where they have it now. OOP, however, shines when your domain is subject to change and developers are willing to sacrifice terseness for flexibility.