A friend of mine has just posited that protected methods (yes, methods) constitute a code smell. That is, they're indicative of potential bad programming practice.
My gut says he's wrong, but I'm struggling to come up with a good example of where they're a good, legitimate solution. For example, I might be tempted to put the protected method in a separate utility class that both base and derived classes could use as required. But that might not cover situations in which the method wants/needs access to data members and/or private methods of that object instance.
What's your take on it?
Can you provide good examples of why protected methods aren't necessarily a bad thing?
Or am I just wrong? :)
BTW, I'll not be marking any answer as accepted on this one, as someone has (correctly) tagged this question as subjective. Just so as you know. :)