Ifs and thens: Is nesting just for the birds?

Software - Practice and Experience - Tập 10 Số 5 - Trang 373-381 - 1980
T. R. G. Green1
1MRC Social and Applied Psychology Unit, University of Sheffield, Sheffield S10 2TN, U.K.

Tóm tắt

AbstractIt 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.

Từ khóa


Tài liệu tham khảo

Barron D. W., 1977, An Introduction to the Study of Programming Languages

H. D.Mills ‘How to write correct programs and know it’ Proceedings of the International Conference on Reliable Software IEEE and Association for Computing Machinery Los Angeles 1975.

Green T. R. G., 1979, Human Interaction with Computers

Kernighan B. W., 1974, The Elements of Programming Style

10.1145/356635.356641

Richards M., 1976, Structured Programming

10.1002/spe.4380090207

P.van den Bosch ‘Review of Sime et al. (1977)’

Computing Reviews(February) Review no. 32 588 (1978).

10.1145/956028.956032

10.1016/0010-0277(72)90028-5

10.1515/ling.1975.13.153.53

Richards V. G., 1979, What Does Problem Representation Affect: Chunk Size, Memory Load, or Mental Process?

10.1016/S0020-7373(77)80045-X

10.1111/j.2044-8325.1977.tb00363.x

10.1093/comjnl/22.2.105

10.1002/spe.4380090902