Ad
  • Custom User Avatar

    Out of curiosity based on how i refactored my solution, why is this more popular of a solution than return (cast) (a+b)? It seems declaring another variable, even a local one, is more work than needs to be done when you can just return the value.

    Is there a best practice that says a declared local variable is less prone to bugs or is it just preference as ease of understanding?