Is storing in a variable the result of a fonction a most powerful way to code an if structures in WordPress?

Is storing in a variable the result of a fonction a most powerful way to code an if structures in WordPress?