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

In the footer-menus-widgets.php template, from Twenty Twenty theme (by Automatic), we can find a way to code a template and call functions that uses variables to store the result of functions like has_nav_menu() or is_active_sidebar() and then use it later in the template in an if structure if ( $has_footer_menu) instead of using directly the…