What's a good naming convention for methods that take conditional action?
问题 Let's say I have a method, Foo() . There are only certain times when Foo() is appropriate, as determined by the method ShouldFooNow() . However, there are many times when the program must consider if Foo() is appropriate at this time. So instead of writing: if ShouldFooNow(): Foo() everywhere, I just make that into one function: def __name(): if ShouldFooNow(): Foo() What would be a good name for this method? I'm having a hard time coming up with a good convention. IfNecessaryFoo() is awkward