r/programming • • Mar 20 '14

Facebook introduces Hack: a new programming language for HHVM

https://code.facebook.com/posts/264544830379293/hack-a-new-programming-language-for-hhvm/
802 Upvotes

526 comments sorted by

View all comments

Show parent comments

16

u/alokmenghrajani Mar 20 '14
if (...) {
  ...
} else if (...) {
  ...
} else {
  ...
}

is allowed. We should update our docs to clarify it.

3

u/argh523 Mar 20 '14

I assumed it would be, but that means you're using "else without {}", which isn't allowed according to the documenation, or that "else if" is now a two-letter keyword. Either way, it's a weird syntactic exception.

But I'm not complaining or anything, I just found it a little odd.