Hacker News new | past | comments | ask | show | jobs | submit login

You missed the `else` branch, not a `return`.



This is one of those arguments I can see both ways, but I ultimately side on the early return side of things over the else branch side of things.

In my opinion, if the function is done its job, it should return. That's what return is for. As the function grows, the else side of the branch gets longer and longer and it is error prone to leave the first branch of the if statement reliant on it.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: