Ifs and thens: Is nesting just for the birds?

T. R. G. Green

Software Practice and Experience · 1980 · 22 citations · 11 references

Concepts

Abstract

Abstract It has become fashionable to criticize nested conditionals, which are supposed to tax the human mind, and to recommend that they should be ‘un‐nested’, turning if‐then‐if into if‐then‐else‐if. Experiment casts doubt on this, however, and suggests that indeed the unnested form is only slightly better in the best conditions and is much worse in unsuitable conditions. Rather than hypothesizing about how the programmer's mind works a much more important principle seems to be to provide perceptual cues that will make program structure manifest rather than latent.

References

11