Here’s a common question I ask myself:
If I have a ThingDoer class and it has a method DoThing(), and I want to log a message stating “Doing a thing”, should I put this logging code in the ThingDoer.DoThing method, or should I keep this code outside of the method, within the caller? I feel like there should be some standard principle to follow here but I don’t know what it is.
Log("Doing Thing");
ThingDoer.DoThing();
vs
void ThingDoer::DoThing()
{
Log("Doing Thing");
}