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

If may be strange because of the asymmetry but I'd actually prefer `if` to be come first all the time and `unless` to come last all the time - precisely because `unless` reads like it's for exceptional circumstances:

  value = cache[key]
  if value?
    return value

  return file.readContents() unless not file.exists()


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

Search: