in reply to if/unless and chaining

I worked for a long time coding Pop-11, a language which did have an elseunless to go along with its unless.

Never caused any problems in my experience.

Wasn't used a huge amount either - but I think it did increase the clarity of some code where it was used.

Personally I think that the argument for consistancy wins over the argument against due to confusion - the fact that we have to continually explain why there isn't an elseunless might be considered a clue :-)

Replies are listed 'Best First'.
Re^2: if/unless and chaining
by Aristotle (Chancellor) on Nov 06, 2002 at 13:22 UTC
    the fact that we have to continually explain why there isn't an elseunless might be considered a clue

    That's no way to argue. Common Beginner Mistakes points out a couple things that are often asked about - but it's plainly obvious that folks asking for them a lot doesn't make them desirable.

    Note I'm not specifically arguing against an elsunless - I'm just saying that the fact it's oft asked about doesn't constitute any evidence for anything other than that it's oft asked about.

    Makeshifts last the longest.

      I completely agree that it is not conclusive proof, but it's not completely irrelevant either. I guess my usability / user-centric design hat is showing :-)

      The fact that novices expect there to be an elseunless, or (to pick another example) expect length to work on arrays and hashes, are evidence that there is confusion.

      In some instances the confusion is due to misconceptions and missing knowledge (e.g. when people try to use symbolic references instead of a hash or something equally useful).

      In other cases it can point to lack of orthagonality, or possibly sub-optimal choice of names (would life be easier if length was called strlength or something similar?).

      The fact that something is often asked about or requested may well be a clue (not proof :-) that there is a problem that needs to be addressed.