Notes on Structured Programming
Edsger W. Dijkstra · TU/e Research Portal · 1970
On our inability to do much.I am fac ed with a b asic problem of presentati on.What I am reall y concerned about i s t he compo s ition of large pr og rams , the text of which may be, s a y , of t he s ame s ize as the who l e text of thi s booklet .Al so I have to include e xamples to illu s trate the various techniqu e s .For prac tical re as on s , the demon str ation programs mu st be smal l , many time s s maller than the " l ife-size programs " I have in mind.M y basi c probl e m i s that prec isel y this differen ce in scale is on e of the major sources of ou r difficulties in programming !It would be very nice if I cou ld illustrate the various techniqu es with small demo n stration programs a nd cou l d co nclude wit h H • • • and wh en faced with a program a thou san d time s as l arg e , you comJXlse it i n the same way .1IThi s common educ a t ional dev ic e , howe ve r, would be sel f-defeatin g as one of my cen tral theme s wi l l be that any two t hings that differ in some respe ct by a factor of already a hund re d or more, are utterly in compar able.Histo ry has s hown that this t ru t h is very hard to believe.Apparent ly we are t oo muc h train e d to di sreg ard diffe r ences in scale , to treat them as "g radual di f fere nces that are not essential n .W e tell ourse lve s that what we can do once, we can also do twice and by induction we fool ours elves into believing that we can do it as man y t im es as needed , but this is just not t rue~ A fac tor of a thousand i s a l re ady fa r beyond our powers of imagination!Let me give you two examples to ru b this in.A one-year old child will crawl o n all fo urs with a speed of, say, on e mile per hou r .But a speed of a thousand mil es per hour i s that of a super s on i c jet. Con s ider ed as ob jects with moving abili ty the child and the jet are incomparable, for whatever one can do the other can not and viCE vers a. Also: one can close one' s eye s and imagine how it feels to be s tanding in an open place, a prairie or a sea s hare, while far away a big, reinless horse i s approaching at a gallop , one can "s ee " it approac hi ng and passing.To do the same wi t h a phalan x of a t hou s and of the s e big beas t s i s me ntal l y impo ss ible: your heart would miss a n umber of beats b y pure panic, if you could !To complicate matters stil l furt her, problems of si ze do not on ly cause me probl ems of pre s entation, but they lie at the heart of the subject: wide s pread