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

Positive branch first is good advice when both branches are roughly even in terms of complexity. If the negative branch is just a return, I’d bail early instead.

Negative first makes else-branches double negative which reads weird, eg. if !userExists {…} else {…}




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: