Yeah, I suppose I just lumped the idea of else if as another keyword when writing branches. It never occurred to me that else and if were separate, and playing in languages like Python only reinforced that idea.
Granted, I'm sure it would have been more clear had Java not been my first language. I don't feel like you get to appreciate language syntax nowadays when languages are more tools than a form of art.
At any rate, interesting point about PHP! So, it has a mixed syntax (i.e. you can use else if with braces or elseif with a colon)?
I've been a professional C, Perl, PHP and Python developer.
I'm an ex-sysadmin from the late 20th century.
These days I do more Javascript and CSS and whatnot, and promote UX and accessibility.
Yeah, I suppose I just lumped the idea of
else if
as another keyword when writing branches. It never occurred to me thatelse
andif
were separate, and playing in languages like Python only reinforced that idea.Granted, I'm sure it would have been more clear had Java not been my first language. I don't feel like you get to appreciate language syntax nowadays when languages are more tools than a form of art.
At any rate, interesting point about PHP! So, it has a mixed syntax (i.e. you can use
else if
with braces orelseif
with a colon)?Yeah, it's mostly so you can use it in templates (since it was a templating language to begin with really):
It's a big ugly, but it's better than this:
I can imagine that second syntax is a nightmare to debug. haha