Hacker News new | past | comments | ask | show | jobs | submit login

Its not just inconsistent with other languages, its consistent with their own language.

Property types are declared before the property name, while function return types are declared after (and with a colon).

Very strange.




If you look at the original C syntax for function types, it is also a bit weird: part of the type (the return type) is placed before, and part (the parameters) after.

That syntax in hack seems more "functional" to me. That said, I must admit that I kind of like the C syntax, because of its oddity.


But inconsistency is consistent with PHP's philosophy ;-)




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

Search: