Posted by stella on July 18, 2008 at 8:31pm
In the latest code review done by chx and Morbus at http://www.drupaltoughlove.com, one of the items commented on was the usage of "else if" instead of "elseif". There's nothing in the Coding Standards doc that specifically states that one should be used over the other, however it is "implied" from the first example on indentation that "elseif" should be used. Can the Coding Standards doc be updated so that it states one way or the other? Personally I don't mind which, but I would prefer if there was consistency. Core itself has a mixture, but with a higher number of "elseif".
An issue on this has already been raised at http://drupal.org/node/282405
Cheers,
Stella

Comments
:)
I'm glad I'm not the only one who was surprised of this statement.
Personally, I prefer
else if, because I find it easier to read, but I also think it doesn't matter at all.Daniel F. Kudwien
unleashed mind
Daniel F. Kudwien
netzstrategen
Some lenguajes don't support elseif
So I'm in favor of
else iffor that reason. :-)"Some languages don't
"Some languages don't support elseif?" I'm not entirely sure what that means. The only language we need to worry about supporting is PHP. The PHP documentation defaults to using elseif. PEAR defaults to using elseif. There are downsides for using "else if" (such as the colon variant, described in the linked issue). "elseif" is one word, compared to "else if", which would make it the only two word syntax in all of Drupal (and in all of PHP).
It just means I believe it's easier to remind one form
It just means I believe it's easier to remind one form than two depending on the languaje being used. With Drupal it's easy to write PHP and Javascript almost at the same time, for instance. But anyway, there are other differences to take into account (ie. boolean constants, null, etc) so it is not that important another difference after all.