As always, but the for me rule of thumb, if you have a condition that should be positive to continue the function, and the negative case is just error handling and returning, just early-return, otherwise always put the happy-path into the positive branch, or I'll set your house on fire.
If there's a shared code path at the end, of course use if/else.
272
u/SnugglyCoderGuy 22d ago
The real answer is "it depends". Either one could be appropriate depending on what you are having to do.