Ad
  • Custom User Avatar

    In this case I would not say one is better than the other. In a lot of more real world cases I do prefer different function heads to catch or guard against non-happy path implementations. Mostly because this prevents deep nesting of conditions which can quickly become hard to read.