On Wed, Mar 07, 2007 at 10:19:23PM +0900, Robert Dober wrote: > On 3/7/07, Chad Perrin <perrin / apotheon.com> wrote: > >On Wed, Mar 07, 2007 at 08:08:35PM +0900, 7stud 7stud wrote: > >> > >> To me 'elif' stands out like a red flag. 'elsif' is a more subtle > >> differentiation, and I couldn't spot it even though I had the problem > >> narrowed down to 3 lines of code. The "Ruby in 20 Minutes" tutorial is > >> obviously geared to the experienced programmer(beginner's don't know > >> what classes are or what an 'attr_accessor' is), so I would suggest > >> putting this in the tutorial: > >> > >> LOOK AT THE ELSIF SYNTAX CAREFULLY--IT'S 'ELSIF' NOT 'ELSEIF' > >> > >> with the 'E' in elseif in red. > > > >Really, your complaint amounts to nothing more than "I'm more used to > >the way language A does it than the way language B does it -- so > >language B must be wrong." > > > >Technically speaking, "elseif", "elsif", and "elif" are equally "wrong". > >To do it right, you'd have to make it "else if". > Chad you remind me of a dispute between fans of Domingo and Pavarotti when > a spanish music magazin explained that such discussions are futile and > nobody can judge at that level. This explaination took a whole article > just in concluding that Carreras was better than both... > > So why would "else if" be better? It's grammatically correct. That was my point -- if you want to complain about one approach being "more wrong" than another, the only one of the four that has any real claim to correctness the others do not is the two-word version, because it at least is grammatically correct English. Of course, I don't much care. I'm perfectly willing to use elseif, elsif, or elif, depending on the language. They all work. Bully for them. My point is not that everyone should start using "else if", but that complaining that "elsif" is somehow "wronger" than "elseif" is silly. You could as easily construct an argument the other way around. Watch this: elseif is more correct because "else" has an E in it! elsif is more correct because it lends to correct pronunciation, while elseif looks like it should be pronounced "ell-safe"! Both are silly, all things considered. Both approaches are "incorrect" by the grammatical rules of English. Of course, in Ruby and Perl "elsif" is grammatically correct, and in VB "elseif" is grammatically correct, while in Python and bash "elif" is grammatically correct. These are not English. They're bash, Perl, Python, Ruby, and Visual Basic, respectively. So, really, none of them are incorrect. Someone remind me, by the way, what non-MS languages use "elseif". I know there are others, but I'm drawing a blank. Surely there must be some language outside of Microsoft's miniature little ecosystem that use elseif. Oh, I just remembered PHP. Well, there you go. VB and PHP. Now all three versions have two languages associated with them in this email. I wonder if it's indicative of something fundamental that the two languages out of the six that I'd be least likely to choose for serious, large-scale development are the two languages that came to mind for "elseif" examples. It's probably only indicative of my taste, I guess. -- CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ] "It's just incredible that a trillion-synapse computer could actually spend Saturday afternoon watching a football game." - Marvin Minsky