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

It is ambiguous when the coder intended to return directly without returning any value like so:

    while (word = getNextWord()) {
      doSomething(word)
      if (i > limit) return
      i++
    } 
Sure, this can be written better but a semi-colon after "return" makes it less ambiguous.


Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: