Topic: else clause

topics > computer science > programming > program control > Group: conditional control

exception handling
case statement
conditional statement
if-then-else test chain


Many selection statements include an optional 'otherwise' or 'else' clause. The otherwise clause allows a conditional statement to be a case statement without labeling all possible alternatives. One researcher sees the otherwise clause as a case termination clause: 'if any selected then ... else ...'.

Otherwise clauses tend to hide information because their entry condition is not explicitly stated. The otherwise clause gets error situations and unexpected events as well as unnamed but valid alternatives. Their use is valid when a subset of alternatives is identified for processing. (cbb 5/80)

Subtopic: if..then..else up

Quote: in SL5, if..then..else is an expression whose result is the result of the then.. or else.. part [»hansDR5_1978]
QuoteRef: weinGM8_1975 ;;36 SELECT every action statement consists of WHEN (condition i) is false//action i// when any are selected//action n+1// when none are selected// action n+1// end select (all false or all true)
QuoteRef: goldA3_1976 ;;20 "This itemization is actually in the form of a conditional statement (if clause - (then clause) else clause).
QuoteRef: wegnE11_1973 ;;704 if if bool then bool1 else bool2 then s1 else s2;

Subtopic: avoding 'else' up

Quote: it is better to redundantly restate the else clause; i.e., case statement better than if..then..else [»atkiLV9_1979]
Quote: in paper solutions, negation seldom used; e.g., 'and' appeared 6.1 times per participant while 'not' appeared 0.1 times [»paneJF2_2001]
Quote: should not have an 'else' clause because it can execute under unexpected or invalid conditions [»buchO5_1976]
Quote: since error correction requires taxon information, it is easier with redundant repetition of predicates
Quote: redundant repetition of predicates allows one to determine the taxon for an action independent of sequence information [»simeME1_1977a]
Quote: in studies found 'if p..not p' far easier to understand than 'if..then..else'; later never used in natural languages [»greeTR_1980]
Quote: NEST-INE (if..not..) mini-language had 1/10 the error lifetime of NEST-BE (if..then..else..) and JUMP (if..goto..)

Related Topics up

Group: exception handling   (12 topics, 314 quotes)
Topic: case statement (25 items)
Topic: conditional statement (8 items)
Topic: if-then-else test chain
(18 items)

Updated barberCB 5/04
Copyright © 2002-2008 by C. Bradford Barber. All rights reserved.
Thesa is a trademark of C. Bradford Barber.