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

  if (!same) {
    return;
  }

  if (!number) {
    return;
  }

  if (!of_braces) {
    return;
  }

  println("but easier to read")


Yes, you should definitely unnest functions and exit early. But the null-coalesced version is shorter still.




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

Search: