Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Agreed. A lot of the time, early exits just make sense. Instead of holding a variable called "succeeded" and doing a bunch of if elses, why not just continue on every failure? You're only testing for half a dozen side-cases and just exit out early when you encounter any one. No need to wrap all of your actual work in 5 levels of if elses.


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

Search: