a1974-knuth_2

Embed Size (px)

Citation preview

  • 7/30/2019 a1974-knuth_2

    1/7

    1974. ACM TuringAward Lecture[The Tnrin g Award citation read by Bernard A. Galler, chairmanof the 1974 "ll'~lringAward Committee, on the presentation of thislecture on November 11 at the ACM Annual Conference in SanDiego.]The A.M. Turi ng Award of the ACM is presented annuallyby the ACM to an individual selected for his contributions of atechnical nature made to the computing community. In particu-lar, these contr ibuti ons should have had significant influence ona major segment of the computer field."The 1974 A.M. Turing Award is presented to ProfessorDonald E. Knuth of Stanford University for a number of majorcontributions to the analysis of algorithms and the design ofprogrammi ng languages, and in particular for his most significantcontributions to the 'art of computer programming' through hisseries of well-known books. The collections of techniques, algo-rithrus and relevan t theory in these books .have served as a focalpoint for developing curricula and as an organizing influence oncomputer science."Such a formal statement cannot put into proper perspectivethe role which Don Knuth has been playing in computer science,and in the computer industry as a whole. It has been my expeli-

    ence with respect to the first recipient of the Turing Award, Pro-fessor Alan J. Perlis, that at every meeting in which he participateshe manages to provide the insight into the problems being dis-cussed that becomes the focal point of discussion for the rest ofthe meeting. In a very simi lar way, the vocabulary, the examples,the algorithms, and the insight that Don Kn uth has provided inhis excellent collection of books and papers have begun to findtheir way into a great many discussions in almost every area ofthe field. This does not happen easily. As every author knows,even a single volume requires a great deal of careful organizationand hard work. All the more must we appreciate the clear viewand the patience and energy which Knuth must have had to planseven volumes and to set about implemen ting his plan so care-fully and thoroughly.It is significant that this award and the others tha t he hasbeen receiving are being given to him after three volumes of hiswork have been published. We are clearly ready to signal toeveryone our appreciation of Don Knuth for his dedication andhis cont ributions to our discipline. I am. very pleased to havechaired the Committee that has chosen Don Knuth to receive the1974 A.M. Turing Award of the ACM.

    C o m p u t e r P r o g r a m m i n gby Donald E. Knuth

    a s a n A r t

    Wh en Communications of the ACM began publ i -cation in 1959, the me mber s of ACM'S Editor ial Boardmade the fol lowing remark as they described thepurposes of acM's periodicals [2]: "If comp uter pro-gramming i s to become an impor ta n t par t o f computerresearch and development , a t ransi t ion of programmingfrom an art to a disciplined science must be effected."Such a goal has been a cont i nual ly recurring themedur ing the ens uin g years; for example, we read in 1970of the "fi rst s teps toward t rans formin g the art ofprogramming into a science" [26]. Meanwhile we haveactually succeeded in making our discipline a science,and in a remarkably s imple way: merely by decidingto cal l i t "computer science."

    Implici t in these remarks is the not ion that there issomething undesirable about an area of human act ivi tyCopyright @ 1974, AsSociation tbr Computing Machinery, Inc.General permission to republish, but not for profit, all or partof this material is granted provided that ACM's copyright noticeis given and that reference is made to the publication, to its dateof issue, and to the fact that reprinting privileges were grantedby permission of the Association for Computing Machinery,Author's address, Computer Science Department , StanfordUniversity, Stanford, CA 94305667

    that is classified as an "art"; it has to be a Sciencebefore it has any real stature. On the other hand, Ihave been working for more than 12 years on a seriesof books cal led "The Art o f Co m p u t e r P ro g ram m i n g / 'People frequently ask me why I picked such a title; andin fact some people apparent ly don't bel ieve that Ireally did so, since I've seen at least one bibliographicreference to some books cal led "The Act of ComputerPro g ram m i n g . "

    In this talk I shall try to explain why I thin k " Ar t"is the appropriate word. I will discuss what it meansfor someth ing to be an art, in cont rast to bein g a science;I will try to examine whether arts are good things orbad things; and I will try to show that a proper view-point of the subject will help us all to improve thequal i ty of what we are now doing.One of the first t imes I wa s ever asked abo ut thetitle of my boo ks was in 1966, dur ing the last previousACM nat ional meet ing held in S outhern Cal i fornia. Thiswas be fo re any of the books were publ ished, and Irecal l having lunch with a fr iend at the convent ionhotel. He knew how conceited t was, already at thatCommunications December 1974of Volume 17the ACM Number 12

  • 7/30/2019 a1974-knuth_2

    2/7

    t i m e , s o h e a s k e d i f I w a s g o i n g t o c a ll m y b o o k s " A nI n t r o d u c t i o n t o D o n K ~ u t h . " I r e p li e d th a t , o n t il ec o n t r a r y , I w a s n a m . i n g t h e b o o k s a f t e r h i ~ . H i s n a m e :A r t E v a n s . ( T h e A r t o f C o m p u t e r P r o g r a m m i n g , i np e r s o n . )

    F r o m t h is s t o r y w e ca n c o n c l u d e t h a t t h e w o r d" a r t " h a s m o r e t h a n o n e m e a n i n g . I n fa ct , o n e o f t h en i c e s t t h i n g s a b o u t t h e w o r d i s t h a t i t i s u s e d i n r n a n yd i f f e r e n t s e n s es , e a c h o f w h i c h i s q u i t e a p p r o p r i a t e i nc o n n e c t i o n w i th c o m p u t e r p r o g r a m m i n g . W h i l e pr e-p a r i n g t h i s t a l k , i i we n t ~ o t h e l i b r a r y t o f i n d o u t w h a tp e o p l e h a v e w r i t te n a b o u t t ir e w o r d " a r t " t h r o u g h t h ey e a r s ; a n d a R e r s p e n d i n g s e v e r a l f a s c i n a t i n g d a y s i n t h es t a c k s , I c a m e t o th e c o n c l u s i o n t h a t " a r t " m u s t b e o n eo f t h e m o s t : i nt e re s t in g w o r d s i n th e E n g l i s h l a n g u a g e .

    T h e A r t s o f O ] dI f w e g o b a c k t o L a t i n r o o t s , w e fi n d a r s , a r t i s

    m e a n i n g " s k i l l . " I t is p e r h a p s s i g n i fi c a n t t h a t t h ec o r r e s p o n d i n g G r e e k w o r d w a s r~ x~ :q , t h e r o o t o f b o t h" t e c h n o l o g y " a n d " t e c h n iq u e . "

    N o w a d a y s w h e n s o m e o n e s p e ak s of " a r t " y o up r o b a b l y t h i n k f ir s t o f " fi n e a r t s " s u c h a s p a i n t i n g a n ds c u l p t u r e , b u t b e f o r e t h e t w e n t i e t h c e n t u r y t h e w o r dwa s g e n e r a l l y u s e d i n q u i t e a d i f f e r e n t s e n s e . S i n c e t h i so l d e r m e a n i n g o f " a r t " s t il l s u r v i v e s i n m a n y i d i o m s ,e s p e c i a l l y w h e n w e a r e c o n t r a s t i n g a r t w i t h s c i e n c e , Iw o u l d l i k e t o s p e n d t h e n e x t f e w m i n u t e s t a l k i n g a b o u ta r t i n i t s c l a s s i c a l s e n s e .

    I n m e d i e v a l t i m e s , t h e f i rs t u n i v e r s i t i e s we r e e s -t a b l i s h e d t o t e a c h t h e s e v e n s o - c a l l e d " l i b e r a l a r t s , "n a m e l y g r a m m a r , r h e t o r i c , l o g i c , a r i t h m e t i c , g e o m e t r y ,m u s i c , a n d a s t r o n o m y . N o t e t h a t t h i s i s q u i t e d i ff e r e n tf r o m t h e c u r r i c u l u m o f t o d a y ' s l i b e r a l a rt s c o ll e g e s, a n dt h a t a t le a s t t h r e e o f t h e o r i g i n a l s e v e n l i b e r al a r t s a r ei m p o r t a n t c o m p o n e n t s o f c o m p u t e r s ci en ce . A t t h a tt i m e , a n " ; a r t " m e a n t s o m e t h i n g d e v i s e d b y m a n ' si n t e ll e c t, a s o p p o s e d t o a c t i v i ti e s d e r iv e d f r o m n a t u r eo r i n s t i n c t ; " l i b e r a l " a r t s w e r e li b e r a t e d o r f r e e, i nc o n t r a s t t o m a n u a l a r t s s u c h a s p l o w i n g ( cf . [ 6 ]) . D u r i n gt h e m i d d l e a g e s t h e w o r d " a r t " b y i ts e lf u su a l l y m e a n tl o g i c [ 4 ], w h i c h u s u .a l ly m e a n t t h e s t u d y o f s y l l o g i s m s .

    S c i e n c e v s . A r tT h e w o r d " s c i e n c e " s e e m s t o h a v e b e e n u s e d t b rm a n y y e a r s in a b o u t t h e s a m e s e n s e as " a r t " ; f o r e x -

    a m p l e , p e o p l e s p o k e a l s o o f t h e s e v e n l i b e r a l s c i e n c e s ,w h i c h w e r e t h e s a m e a s t h e s e v e n l i b e ra l a r t s [ 1].D u n s . S c o t u s i n t h e t h i r t e e n t h c e n t u r y c a l l e d l o g i c " t h eS c i e n c e o f S c i en c e s , a n d t h e A r t o f A r t s " ( c f. [1 2, p .3 4 f ] ) . A s c i v i l i z a t i o n a n d l e a r n i n g d e v e l o p e d , t h e w o r d s

    t o o k o n m o r e a n d m o r e i n d e p e n d e n t m e a n i n g s , "scJ, .e n c e " b e i n g u se d t o s t a n d f o r k n o w l e d g e , a n d " a r t "f o r t h e a p p l i c a t i o n o f k n o w ~ e d g e . T h u s , t h e s c i e n c e o fa s t r o n o m y w a s t h e b a s is f o r t h e a r t o f n a v i g a t i o n . T h es i t u a t i o n w a s a l m o s t e x a c t l y l i k e t h e w a y i 'n w h i c h w en o w d i s ti n g u i s h b e t w e e n ~ s c i e n c e " a n d " e n g i n e e r i n g . "

    M a n y au t h o r s w r o t e a b o u t t h e r e l a t i o n s h i p b e t w e e na r t a n d s c i e n c e i n t h e n i n e t e e n t h c e n t u r y , a n d I b e l i e v et h e b e s t d i s c u s s i o n w a s g i v e n b y J o h n S t t t a r t M i l l. Hes a i d t i le f o l l o w i n g t h i n g s , a m o n g . o t h e rs , :in 1 8 43 [ 2 8 ] :

    Several sciences are often necessary to fnrm the groundworkof a single art. Such is the complication o f human affairs, that toenable one thing to be dc~t~e,it is often requisite to k~2ow the natureand properties of many things ... Art in general consists of thetruths o f Science, arranged in the most convenient order fo r practice,instead .of the order which is the most convenient for thought.Science groups and arranges its truths so as to enable us to takein a t one view as much as p ossible of the general order of theuniverse. A rt .. . brings together flom parts of the field of sciencemost remote fi:om one another, the truths relating to the productionof the different and heterogeneous conditions necessary to eacheffSct which the exigencies of" practical life require.

    A s I w a s I L o ok in g u p t h e s e t h i n g s a b o u t t h e m e a n -i n g s o f " a r t , " I f o u n d t h a t a u t h o r s h a v e b e e n c a l li n gf b r a t r a n s i t i o n f r o m a r t t o s c i e n c e { ' o r a t l e a s t t woc e n t u r i es . F o r e x a m p l e , t h e p r e f a c e t o a t e x t b o o k o nm i n e r a l o g y , wr i t t e n i n 1 7 8 4 , s a i d t h e f ' o l l o wi n g [1 7 1:" P r e v i o u s t o t h e y e a r t 7 8 0, m i n e r a l o g y , t h o u g h t o l e r -a b l y u n d e r s t o o d b y m a n y a s a n A r t , c o u l d s c a r c e bed e e m e d a S c i e n c e . "

    A c c o r d i n g to m o s t d i c ti o n a ri e s " s c i e n c e " m e a n sk n o w l e d g e t h a t h a s b e e n l o g ic a l l y a r r a n g e d a n d s y s t e m -a t i z e d in t h e f o r m o f g e ne r a l " l a w s . " T h e a d v a n t a g e o fs c i e n c e i s t h a t i t s a v e s u s f r o m t h e n e e d t o t h i n k t h i n g st h r o u g h i n e a c h in d i v i d u a l c a s e ; w e c a n t u r n o u rt h o u g h t s t o h ig h e r -l e v el c o n c e p t s . A s J o h n R u s k i nwr o t e i n 1 8 53 [ 3 2 ] : " T h e w o r k o f s c i e n c e i s t o s u b s t i t u t ef a c ts f o r a p p e a r a n c e s , a n d d e m o n s t r a t i o n s t b r i m p r e s-s i o n s . "

    i t s e em s t o m e t h a t i f t h e a u t h o r s I s tu d i e d w e r ew r i t i n g t o d a y , t h e y w o u l d a g r e e w i t h t h e f o l l o w i n gc h a r a c t e r i z a t i o n : S c i e n c e i s k n o w l e d g e w h i c h w e u n d e r -s t a n d s o w e l t t h a t w e c a n t e a c h i t t o a c o m p u t e r ; a n di f w e d o n ' t f u l l y u n d e r s t a n d s o m e t h i n g , i t is a n a r t t od e a l w i t h it . S i n c e t h e n o t i o n o f a n a l g o r i t h m o r ac o m p u t e r p r o g r a m p r o v i d e s u s w i t h a n e x t r e m e l y u s e f u lt e s t f o r t h e d e p t h o f o u r k n o w l e d g e a b o u t a n y g i v e ns u b j e c t , t h e p r o c e s s o f g o in g f r o m a n a r t t o a s c i e n c em e a n s t h a t w e l e a r n h o w t o a u t o m a t e s o m e t h i n g .

    A r t i f i c i a l i n t e l l i g e n c e h a s b e e n m a k i n g s i g n i f i c a n tp r o g r e ss , y e t th e r e i s a h u g e g a p b e t w e e n w h a t c o m -p u t e r s c a n d o i n t h e f o r e s e e a b l e f u t u r e a n d w h a to r d i n a r y p e o p l e c a n d o . T h e m y s t e r i o u s i n s i g h t s t h a t

    66 8 Comm unications December 1974of Volume 17" he ACM Number 12

  • 7/30/2019 a1974-knuth_2

    3/7

    p e o p l e h a v e w h e n s p e a k i n g , l i s t e n i n g , c r e a t i n g , a n de v e n w h e n t h e y a r e p r o g r a m m i n g , a r e s t i l l b e y o n d t h er e a c h o f s c ie n c e ; n e a r l y e v e r y t h i n g w e d o i s st il l a n a r t .

    F r o m t h is s t a n d p o i n t i t i s c e r [ a i n l y d e s ir a b l e t o m a k ec o m p u t e r p r o g r a m m i n g a s c i e n c e , a n d w e h a v e i n d e e dc o m e a l o n g w a y i n t h e 1 5 y e a r s s i n c e t h e p u b l i c a t i o no f th e r e m a r k s I q u o t e d a t t h e b e g i n n i n g o f th i s t a lk .F i ft e e n y e a r s a go c o m p u t e r p r o g r a m m i n g w a s so b a d l yu n d e r s t o o d t h a t h a r d l y a n y o n e e v e n thought a b o u tp r o v i n g p r o g r a m s c o r r e c t ; w e j u s t f id d l ed w i t h a p r o -g r a m u n t il w e " k n e w " i t w o r k e d . A t t h a t t im e w e d i d n ' te v e n k n o w h o w t o e x p r e s s t h e cor~cept t h a t a p r o g r a mw a s c o r r e c t , i n a n y r i g o r o u s w a y . I t is o n l y i n r e c e n ty e a r s t h a t w e h a v e b e e n l e a r n i n g a b o u t t h e p r o c e s s e s o fa b s t r a c t i o n b y w h i c h p r o g r a m s a r e w r i tt e n a n d u n d e r -s t o o d ; a n d t h i s n e w k n o w l e d g e a b o u t p r o g r a m m i n g i sc u r r e n t l y p r o d u c i n g g r e a t p a y o f f s in p r a c t ic e , e v e nt h o u g h I } w p r o g r a m s a r e a c t u a l l y p r o v e d c o r r e c t w i t hc o m p l e t e r i g o r , s i n c e w e a r e b e g i n n i n g t o u n d e r s t a n dt h e p r i n c i p l es o f p r o g r a m s t r u c t u r e . T h e p o i n t i s th a tw h e n w e w r i t e p r o g r a m s t o d a y , w e k n o w t h a t w e c o u l di n p r i n c i p l e c o n s t r u c t f o r m a l p r o o f ~ o f t h e i r c o r r e c t n e s si f w e r e a ll y w a n t e d t o , n o w t h a t w e u n d e r s t a n d h o ws u c h p r o o f ~ a r e f o r m u l a t e d . T h i s s c i e n ti f ic b a s i s is r e -s u l t i n g i n p r o g r a m s t h a t a r e s i g n i f i c a n t l y m o r e r e l i a b l et h a n t h o s e w e w r o t e in f o r m e r d a y s w h e n i n t u i ti o n w a st h e o n l y b a s i s o f c o r r e c t n e s s .

    T h e f i e l d o f " a u t o m a t i c p r o g r a m m i n g " i s o n e o ft h e m a j o r a r e a s o f a r t i f i c i a l i n t e l l i g e n c e r e s e a r c h t o d a y .I t s p r o p o n e n t s w o u l d l o v e t o b e a b l e t o g i v e a le c t u r ee n t it le d " C o m p u t e r P r o g r a m m i n g a s a n A r t if a c t "( m e a n i n g t h a t p r o g r a m m i n g h a s b e c o m e m e r e l y a re li co f b y g o n e d a y s ) , b e c a u s e t h e i r a i m i s t o c r e a te m a c h i n e st h a t w r i t e p r o g r a m s b e t t e r t h a n w e c a n , g i v e n o n l y t h ep r o b l e m s p e c i f i c a t i o n . P e r s o n a l l y t d o n ' t t h i n k s u c h ag o a l w i l l e v e r b e c o m p l e t e l y a t t a i n e d , b u t I d o t h i n kt h a t t h e i r r e s ea r c h i s e x t r e m e l y i m p o r t a n t , b e c a u s ee v e r y t h i n g w e l e a r n a b o u t p r o g r a m m i n g h e l p s u s t oi m p r o v e o u r o w n a r t i s t ry , i n t h i s s e n s e w e s h o u l dc o n t i n u a l l y b e s t r i v i n g t o t r a n s f o r m every a r t i n t o as c i e n c e : i n t h e p r o c e s s , w e a d v a n c e t h e a r t .S c i e n c e a n d A r tO u r d i sc u s si o n i n d i ca t es t h a t c o m p u t e r p r o g r a m m i n gi s b y n o w both a s c i e n c e a n d a n a r t , a n d t h a t t h e t w oa s p e c t s n ic e l y c o m p l e m e n t e a c h , o t he r . A p p a r e n t l y m o s ta u t h o r s w h o e x a m i n e s u c h a q u e s t i o n c o m e t o t h is s a m ec o n c l u s i o n , t h a t t h e i r s u b j e c t i s b o t h a s c i e n c e a n d a na r t , w h a t e v e r t h e i r s u b j e c t is ( c f . [ 2 5 ]) . I f o u n d a b o o ka b o u t e l e m e n t a r y p h o t o g r a p h y , w r i t t e n i n 1 89 3, w h ic hs t a te d t h a t " t h e d e v e l o p m e n t o f th e p h o t o g r a p h i c i m a g ei s bo th an a r t and a s c i ence" [13 ] . t n f ac t , w hen I f i r s t

    p i c k e d u p a d i c t io n a r y i n o r d e r t o s t u d y t h e w o r d s " a r t "a n d " s c i e n c e , " I h a p p e n e d t o g l a n c e a t t h e e d i t o r ' sp r e f a c e , w h i c h b e g a n b y s a y in g , " T h e m a k i n g o f ad i c t i o n a r y i s b o t h a s c i e n c e a n d a n a r t . " T h e e d i t o r o fF u n k & W a g n a l l ' s d i c t i o n a r y [ 2 7] o b s e r v e d t h a t t h ep a i n s t a k i n g a c c u m u l a t i o n a n d c l a s s i fi c a ti o n o f d a t aa b o u t w o r d s h a s a s c i e n t i f i c c h a r a c t e r , w h i l e a w e l l -c h o s e n p h r a s i n g o f d e f in i t io n s d e m a n d s t h e a b i l i t y t ow r i te w i t h e c o n o m y a n d p r e c i s i o n : " T h e s c i e nc e w i t h o u tt i l e a r t i s l i ke ly t o be i ne f f ec t i ve ; t he a r t w i thou t t i l esc ie r~ ce i s ce r t a in t o b e i nac cu ra t e . "

    W h e n p r e p a r i n g t h i s t a l k I l o o k e d t h r o u g h t h e c a r dc a t a l o g a t S t a n f o r d l i b r a r y t o s e e h o w o t h e r p e o p l eh a v e b e e n u s i n g t i l e w o r d s " a r t " a n d " s c i e n c e " i n t h et i tl e s o f t h e i r b o o k s . T h i s t u r n e d o u t t o b e q u i t e i n t e r -e s t i n g .F o r e x a m p l e , I f o u n d t w o b o o k s e n t i t l e d T h e A r tof Playing the Piat~o [5 , 15 ] , and o the r s ca l l ed T heSciel~ce of Pianoforte 7"echtl ique [10], The Science ofPiaezofi)rte Practice [30 ] . T he re i s a l so a book ca l l edThe Art oJ" Piano Playing: A SciemiJTc Appro ach [22].

    T h e n I f o u n d a n i c e l i t t l e b o o k e n t i t l e d 7"he GentleA r t c f M a t h e m a t i c s [ 3 1 ] , w h i c h m a d e m e s o m e w h a ts a d t h a t I c a n ' t h o n e s t ly d e s c r ib e c o m p u t e r p r o g r a m -m i n g a s a " g e n t l e a r t . "

    I h a d k n o w n f o r s e v e r a l y e a r s a b o u t a b o o k c a l le dThe Ar t o f Compu ta t ion , p u b l i s h e d i n S a n F r a n c i s c o ,1 87 9, b y a m a n n a m e d C . F r u s h e r H o w a r d [ 14 ]. T h i sw a s a b o o k o n p r a c t i c a l b u s i n e s s a r i t h m e t i c t h a t h a ds o l d o v e r 4 0 0 , 0 0 0 c o p i e s i n v a r i o u s e d i t i o n s b y 1 8 90 .1 w a s a m u s e d t o r e a d t h e p r e f a c e , s i n ce i t s h o w s t h a tH o w a r d ' s p h i l o s o p h y a n d t h e i n t e n t o f h i s t it le w e r eq u i t e d i f f e r e n t f r o m m i n e ; h e w r o t e : " A k n o w l e d g e o ft h e S c i e nc e o f N u m b e r i s o f m i n o r i m p o r t a n c e ; s k i l l i nt h e A r t o f R e c k o n i n g i s a b s o l u t e l y i n d i s p e n s i b le . "

    S e v e r a l b o o k s m e n t i o n b o t h s c i e n c e a n d a r t i n t h e i rt i t l e s , no t ab ly 7"he Science of Being a nd Ar t o f Livingb y M a h a r i s h i M a h e s h Y o g i [2 4] . T h e r e i s a l so a b o o kc a l l e d The Art of Scienti f i ' c Discovery [11] , whicha n a l y z e s h o w s o m e o f t h e g r e a t d i s c o v e r i e s o f s c ie n c ew e r e m a d e .

    S o m u c h f o r th e w o r d " a r t " i n i ts c l a s si c a l m e a n i n g .A c t u a l l y w h e n I c h o s e t h e t it le o f m y b o o k s , I w a s n ' tt h i n k i n g p r i m a r i l y o f a r t in t h i s s en s e , I w a s t h i n k i n gm o r e o f i ts c u r r e n t c o n n o t a t i o n s . P r o b a b l y t h e m o s ti n t e re s t i n g b o o k w h i c h t u r n e d u p i n n a y s e a r c h w a s af a i r l y r e c e n t w o r k b y R o b e r t E . M u e l l e r c a l l e d Th eScience of Art [ 29 ]. O f a l l t h e b o o k s I ' v e m e n t i o n e d ,M u e l l e r ' s c o m e s c l o s e s t t o e x p r e s s i n g w h a t I w a n t t om a k e t h e c e n t r a l t h e m e o f m y t a l k t o d a y , i n t e r m s o fr e a l a r t i s t r y a s w e n o w u n d e r s t a n d t h e t e r m . H e o b -s e r v e s: " I t w a s o n c e t h o u g h t t h a t t h e i m a g i n a t i v e

    66 9 Comm unications December 1974of Volume 17the ACM Number 12

  • 7/30/2019 a1974-knuth_2

    4/7

    o u t l o o k of t h e a r t i s t w a s d e a t h f o r' t h e s c ie n t i s t . An dt h e l o g i c o f s c i e n c e s e e m e d t o s p e l l ' d o o m t o a ll p o s s i b l ea r t i s t ic f l i g h ts o f f a n c y . " H e g o e s o n t o e x p l o r e t h ea d v a n t a g e s w h i c h a c t u a l l y d o r e s u l t f r o m a s y n t h e s i s o fs c i e n c e a n d a r t .

    A s c i e n t if i c a p p r o a c h i s g e n e r a l l y c h a r a c t e r i z e d b yt h e w o r d s l o g i c a l , s y s t e m a t i c , i m p e r s o n a l , c a l m , r a -t i o n a l , w h i l e a n a r ti s t ic a p p r o a c h i s c h a r a c t e r i z e d b y t h ew o r d s a e s t h e t i c , c r e a t i v e , h u m a n i t a r i a n , a n x i o u s , i r -r a t i o n a l . I t s e e m s t o m e t h a t b o t h o f th e s e a p p a r e n t l yc o n t r a d i c t o r y a p p r o a c h e s h a v e g re a t v a lu e w i th r e sp e c tto c o m p u t e r p r o g r a m m i n g .

    E m m a L e h m e r w r o t e i n 19 56 t h a t s h e h a d f o u n dc o d i n g t o b e " a n e x a c t i n g s c i e n c e a s we l l a s a n i n -t r i g u i n g a r t " [ 23 ]. H . S . M . C o x e t c r r e m a r k e d ira 1 95 7t h a t h e s o m e t i m e s f e lt " m o r e l i ke a n a rt i s t th a n as c i e n t i s t " [ 7 J . T h i s w a s a t t h e t i m e C . P . S n o w w a sb e g i n n i n g t o v o i ce h is a l a r m a t th e g r o w i n g p o l a r i z a t i o nb e t w e e n " t w o c u l t u r e s " o f e d u c a t e d p e o p l e [ 34 , 3 5 ].H e p o i n t e d o u t t h a t w e n e e d t o c o m b i n e s c i en t if i c a n da r t i s t i c v a l u e s i f ' we a r e t o m a k e r e a l p r o g r e s s .

    W o r k s o f A r tW h e n i ' m s i t t i n g i n a n a u d i e n c e l i s t e n i n g t o a l o n g

    l e c t u re , m y a t t e n t i o n u s u a l l y s t a r t s t o w a n e a t a b o u tt h is p o i n t i n t h e h o u r . S o I w o n d e r , a r e y o u g e t t i n g al it tl e ti r e d o f m y h a r a n g u e a b o u t * ' s c i e n c e " a n d " a r t " ?

    r e a l l y h o p e t h a t y o u ' l l b e a b l e t o l i s t e n c a r e f u l l y t ot h e r e s t o f t h i s, a n y w a y , b e c a u s e n o w c o m e s t h e p a r ta b o u t w h i c h I f le d m o s t d e e p l y .

    W h e n I s p e a k a b o u t c o m p u t e r p r o g r a m m i n g a s a na r t , I a m t h i n k i n g p r i m a r i l y o f i t a s a n a r t f o r m , i n ana e s t h e t i c s e n s e. T h e c h i ef " g o a l o f m y w o r k a s e d u c a t o ra n d a u t h o r i s t o h e l p p e o p l e l e a r n h o w t o w r i t e beau-t iJM programs . I t is f o r t h i s r e a s o n 1 wa s e s p e c i a l l yp l e a s e d t o l e a r n r e c e n t l y [ 32 ] t h a t m y b o o k s a c t u a l l ya p p e a r i n t h e F i n e A r t s L i b r a r y a t C o r n e I 1 U n i v e r s i t y .( H o w e v e r , t h e t h r e e v o l u m e s a p p a r e n t l y s it t h e r e n e a t l yo n t h e s h e l f, w i t h o u t b e i n g u s e d , s o I ' m a f r a i d t h el i b r a r ia n s m a y h a v e m a d e a m i s t a k e b y i n te r p r et i n g m yt i t l e l i t e r a l ! y . )

    M y f e e l i n g i s t h a t w h e n w e p r e p a r e a p r o g r a m , i tc a n b e l i ke c o m p o s i n g p o e t r y o r m u s i c ; a s A n d r e iE r s h o v h a s s a i d [ 9 ], p r o g r a m m i n g c a n g i ve u s b o t hi n t e l le c t u a l a n d e m o t i o n a l s a t i s f a c t i o n , b e c a u s e i t i s ar e al a c h i e v e m e n t t o m a s t e r c o m p l e x i t y a n d t o e s ta b l is ha s y s t e m o f c o n s i s t e n t r u l e s .

    F u r t h e r m o r e w h e n w e r e a d o t h er p e o p l e ' s p r o g r a m s ,w e c a n r e c o g n i z e s o m e o f t h e m a s g e nu i n e w o r k s o fa r t . I c a n s t il l r e m e m b e r t h e g r e a t t h r il l i t w a s f o r m et o r e a d t h e l i s t i n g o f S t a n P o l e y ' s S OA p I I a s s e m b l y6 7 0

    p r o g r a m i n 1 95 8 ; y o u p r o b a b l y t h i > ,k t % c r u z y , a n ds t y l e s h a v e c e r t a i n l y c h a n g e d g r c a l ti y s i n c e t h e n , b u t a tt h e t i m e it m e a n t a g r e a t d e a l t o m e t o s e e h o w e l e g a n ta sy s t em p r o g r a m c o u l d b e , e sp e c i a ll y b y c o m p a r i s o nw i t h t h e h e a v y - h a n d e d c o d i n g f o u n d i n o t h e r l i st i n gs Ih a d b e e n s t u d y i n g a t t h e s a m e t i m e . ' l ' h c p o s s i b i l i t y o fw r i t i n g b e a u t i f u l p r o g r a m s , e v e n ii1 a s s c m b i y h . m g u a g e ,i s w h a t g o t m e h o o k e d o n p r o g r a m m i n g i n th e f ir stp l a c e .

    S o m e p r o g r a m s a r e e l e g a n t , s o m e a r e e x q u i s i t e ,s o m e a r e s p a r k l i n g . M y c l a i m i s t h a t i t i s p o s s i b l e t owr i t e grand p r o g r a m s , treble p r o g r a m s , t r u l y magnif i-cent o n e s [T a s t e a n d S t y l e

    Th e i d e a o f " s tyle in p r o g r a m m i n g is n o w c o m i n g t ot h e f o r e f r o n t a t l a st , a n d 1 h o p e t h a t m o s t o f" y o u h a v eseen the excei1et~t l i t t le book on t2/emeHts' of Program..ruing Style b y K e r n i g h a n a n d P t a u g e r [ 1 6 ] . i n t h i sc o n n e c t i o n i t is m o s t i m p o r t a n t f o r u s a ll t o r e m e m b e rt h a t t h e r e is n o o n e " b e s t " s t y le ; e v e r y b o d y h a s h i so w n p r e f e r e n c e s, a n d i t i s a m i s t a k e t o t r y t o f o r c ep e o p l e i n t o an u n n a t u r a l m o l d . W e o f t e n h e a r ' t h es a y i n g , " I d o n ' t k n o w a n y t h i n g a b o u t a r t , b u t I k n o ww h a t I l i k e . " T h e i m p o r t a n t t h i n g i s t h a t y o u r e a l l yl/fie t h e s t y I e y o u a r e u s i n g ; i t s h o u l d b e t h e b e s t wa yy o u p r e f e r t o e x p r e s s y o u r s e l f ,

    Ed s g e r D i j k s t r a s t r e s s e d t h i s p o i n t i n t h e p r e t e n c et o h i s Short Irl trodt~ction to the Art ~d P r o g r a m m i n g [8[ :

    I t is my purpose to t ransmit the i rnportance of good tas te andstyle in programming, [but] the specific elements of style presentedserve only to illustrate what benefits can be derived from "style"in general. In this respect I feel akin to the teac her of" com posit ionat a conservatory: He does not teach Ms pupils how to com pose aparticular symphony, he must help his pupils to find their ownstyle and must explain to them what is implied by this. (It has beenthis analogy that made me ta lk about "The Art of Programming.")N o w w e m u s t a s k o u r s e lv e s , W h a t i s g o o d s t yl e ,

    a n d w h a t i s b a d s t y le ? W e s h o u l d n o t b e t o o r i g i da b o u t t h i s in j u d g i n g o t h e r p e o p l e ' s w o r k . T h e e a r l yn i n e t e e n t h -c e n t u r y p h i l o s o p h e r J e r e m y B e n t h a m p u t i tt h i s way [3 , Bk . 3 , Ch . t1 :

    Judges of elegance and taste consider them selves as benefactorsto the human race, whilst they are really only the interrupters oftheir p lea su re .. . Ti~ere is no taste which deserves the epithet good,unless it be the taste for such employments which, to the pleasureactually produced by them, conjoin some contingent or Ajtureutility: there is no taste which deserves to be characterized as bad,unless it be a taste for some occupation which has a mischievoustendency.W h e n w e a p p l y o u r o w n p r e j u di c e s t o " r e f o r m " s o m e -o n e e ls e ' s t a s te , w e m a y b e u n c o n s c i o u s l y d e n y i n g h i ms o m e e n t i r e l y l e g i t i m a t e p l e a s u r e . T h a t ' s w h y I d o n ' tComm unicat ions December 1974of Volume 17the ACM Num ber 12

  • 7/30/2019 a1974-knuth_2

    5/7

    c o n d e n m a l o t o f t h in g s p r o g r a m m e r s d o , e v e n th o u g ht w o u l d n e v e r e n j o y d o i n g t h e m m y s e l f. T h e i m p o r t a n tt h i n g i s t h a t t h e y a r e c r e a t i n g s o m e t h i n g they feel isbeau t i f u l .i n t h e p a s s a g e I j u s t q u o t e d , B e n t h a m d o e s g i v e u ss o m e a d v i c e a b o u t c e r t a i n p r i n c ip l e s o f a e s t h e t ic s w h i c ha r e b e t t e r t h a n o t h e r s , n a m e l y th e " u t i l i t y " o f th er e s u lt . W e h a v e s o m e f r e e d o m i n s e t ti n g u p o u r p e r s o n a ls t a n d a r d s o f b e a u t y , b u t i t is e s p e c ia l ly n ic e w h e n t h et h i n g s w e r e g a r d a s b e a u t if u l a r e a ls o r e g a r d e d b y o t h e rp e o p l e a s u s e f u l . I m u s t c o n f e s s t h a t I r e a ll y e n j o yw r i t i n g c o m p u t e r p r o g r a m s ; a n d I e s p e c i a ll y e n j o yw r i t i n g p r o g r a m s w h i c h d o t h e g r e a t e s t g o o d , i n s o m esense .

    T h e r e a r e m a n y s e n s e s i n w h i c h a p r o g r a m c a n b e" g o o d , " o f c o u r s e . I n t h e f i rs t p l a c e , it 's e s p e c i a ll y g o o dt o h a v e a p r o g r a m t h a t w o r k s c o r r e c t l y . S e c o n d l y i t i so k e n g o o d t o h a v e a p r o g r a m t h a t w o n ' t b e h a r d t oc h a n g e , w h e n t h e t i m e % r a d a p t a t i o n a r i s e s . B o t h o ft h e s e g o a l s a r e a c h i e v e d w h e n t h e p r o g r a m i s e a s i l yr e a d a b l e a n d u n d e r s t a n d a b l e t o a p er s o n w h o k n o w st h e a p p r o p r i a t e l a n g u a g e .

    A n o t h e r i m p o r t a n t w a y f o r a p r o d u c t i o n p r o g r a mt o be good i s ~ or i t t o i n t e r ac t g r ace f u l l y w i t h i t s u se r s ,e s p e c i a l ly w h e n r e c o v e r i n g fl 'o m h u m a n e r r o r s i n t h ei n p u t d a t a . l t ' s a re a l a r t t o c o m p o s e m e a n i n g f u l e r r o rme ssages o r t o des i gn f l ex i b l e i npu t f o r m a t s w h i ch a r en o t e r r o r - p r o n e .

    A n o t h e r i m p o r t a n t a s p e c t o f p r o g r a m q u a l i ty ist h e e f f i c i en c y w i t h w h i c h t h e c o m p u t e r ' s r e s o u r c e s a r ea c t u a l l y b e i n g u s e d . I a m s o r r y t o s a y t h a t m a n y p e o p l en o w a d a y s a r e c o n d e m n i n g p r o g r a m e f f i ci e n cy , t e l li n gus t ha t i t i s i n bad t a s t e . T he r ea son f o r t h i s i s t ha t w ea r e n o w e x p e r i e n c i n g a r e a c t i o n f r o m t h e t im e w h e ne f f ic i e n c y w a s t h e o n l y r e p u t a b l e c r i t e r io n o f g o o d n e s s ,a n d p r o g r a m m e r s i n t h e p a s t h a v e te n d e d t o b e sop r e o c c u p i e d w i t h e ff i ci e n cy t h a t t h e y h a v e p r o d u c e dn e e d l e s s l y c o m p l i c a t e d c o d e ; t h e r e s u l t o f t h is u n n e c e s -s a r y c o m p l e x i t y h a s b e e n t h a t n e t e f fi c ie n c y h a s g o n ed o w n , d u e t o d i ff i cu l ti e s o f d e b u g g i n g a n d m a i n t e n a n c e .

    T h e r e a l p r o b l e m i s t h a t p r o g r a m m e r s h a v e s p e n tf a r t o o m u c h t i m e w o r r y i n g a b o u t e f f i ci e n c y i n t h ew r o n g p l a c e s a n d a t t h e w r o n g t i m e s ; p r e m a t u r eo p t i m i z a t i o n i s t h e r o o t o f a l l e v i l ( o r a t le a s t m o s t o f i t)i n p r o g r a m m i n g .W e s h o u l d n ' t b e p e n n y w is e a n d p o u n d f o o l i sh , n o rs h o u l d w e a l w a y s t h i n k o f e f f ic i e n cy i n t e r m s o f s om a n y p e r c e n t g a i n e d o r l o s t i n t o t a l r u n n i n g t i m e o rs p a c e . W h e n w e b u y a c ar , m a n y o f u s a r e a l m o s tob l i v i ous t o a d i f f e r en ce o f $ 50 o r $ 100 in i t s p r i ce ,w h i l e w e m i g h t m a k e a s p e ci a l t r ip t o a p a r t i c u l a rs t o r e i n o r d e r t o b u y a 50 it e m f o r o n l y 2 5 #. M y p o i n t

    i s t ha t t he r e i s a t i me a nd p l ace f o r e ff i c iency ; I haved i s c u s s e d i t s p r o p e r r o l e i n m y p a p e r o n s t r u c t u r e dp r o g r a m m i n g , w h i c h a p p e a r s i n th e c u r r e n t i ss u e o fComputing Surveys I21].L e s s F a c i l i t i e s : M e r e E n j o y m e n t

    O n e r a t h e r , c u ri o u s t h i n g I ' v e n o t i c e d a b o u t a e s t h e t i csa t i s f ac t i on i s t ha t ou r p l ea su r e i s s i gn i f i can t l y enhancedw h e n w e , a c c o m p l i s h s o m e t h i n g w i t h l i m i t e d t o o l s .F o r e x a m p l e , th e p r o g r a m o f w h ic h I p e r s o n a ll y a mm o s t p l e a s e d a n d p r o u d is a c o m p i l e r I o n c e w r o t e f o ra p r im i t i v e m i n i c o m p u t e r w h i c h h a d o n l y 4096 w o r d so f m e m o r y , t 6 b i t s p e r w o r d . I t m a k e s a p e r s o n f e e ll i k e a r e a l v i r t u o s o t o a c h i e v e s o m e t h i n g u n d e r s u c hseve r e r e s t r i c t i ons .

    A s i m i l a r p h e n o m e n o n o c c u r s i n m a n y o t h e r c o n -t ex t s . For exampl e , peopI e o f t en s eem t o f a l l i n l ovew i t h t h e i r V o l k s w a g e n s b u t r a r e l y w i t h t h e i r L i n c o l nC o n t i n e n t a l s ( w h i ch p r e s u m a b l y r u n m u c h b e t te r ) .W h e n I l e a r n e d p r o g r a m m i n g , i t w a s a p o p u l a r p a s t h n et o d o a s m u c h a s p o s s i b l e w i t h p r o g r a m s t h a t f i t o no n l y a s i ng l e p u n c h e d c a r d . I s u p p o s e i t ' s t h is s a m ep h e n o m e n o n t h a t m a k e s A PL e n t h u s i a s ts r e l is h t h e i r" o n e - l i n e r s . " W h e n w e t e a ch p r o g r a m m i n g n o w a d a y s ,i t i s a cu r i ous f i act t lha t w e r a r e l y cap t u r e t he hea r t o f as t u d e n t f o r c o m p u t e r s c i en c e u n t il h e h a s t a k e n a c o u r s ew h i c h a l lo w s " h a n d s o n " e x p e r i e n c e w i th a m i n i c o m -p u t e r . T h e u s e o f o u r l a rg e - s ca l e m a c h i n e s w i t h t h e i rf a n c y o p e r a t i n g s y s t e m s a n d l a n g u a g e s d o e s n ' t r e a l l ys e e m t o e n g e n d e r a n y l o v e f o r p r o g r a m m i n g , a t l e a stno t a t f i r s t .

    I t ' s n o t o b v i o u s h o w t o a p p l y t h i s p r i n c i p l e t oi n c r e a s e p r o g r a m m e r s ' e n j o y m e n t o f t h ei r w o r k . S u r e lyp r o g r a m m e r s w o u l d g r o a n i f th e ir m a n a g e r s u d d e n l ya n n o u n c e d t h a t t h e n e w m a c h i n e w i lt h a v e o n l y h a l f a sm u c h m e m o r y a s th e o l d. A n d I d o n ' t t hi n k a n y b o d y ,e v e n t h e m o s t d e d i c a t e d " p r o g r a m m i n g a r t is t s ," c a n b ee x p e c t e d t o w e l c o m e s u c h a p r o s p e c t , s i n c e n o b o d yl i k e s t o l o s e f a c i l i t i e s u n n e c e s s a r i l y . A n o t h e r e x a m p l em a y h e l p t o c l a r if y t h e s i t u a t i o n : F i l m - m a k e r s s t r o n g l yr e s i s te d t h e i n t r o d u c t i o n o f t a lk i n g p i c t u r e s i n th e 1 9 2 0 'sb e c a u s e t h e y w e r e j u s t ly p r o u d o f t h e w a y t h e y c o u l dc o n v e y w o r d s w i t h o u t s o u n d . S i m i l a r ly , a tr u e p r o g r a m -m i n g a r t i s t m i g h t w e l l re s e n t t h e i n t r o d u c t i o n o f m o r ep o w e r f u l e q u i p m e n t ; t o d a y ' s m a s s s t o r a g e d e v i c e st e n d t o s p o i l m u c h o f t h e b e a u t y o f o u r o l d t a p e s o r t i n gm e t h o d s . B u t t o d a y ' s f i l m m a k e r s d o n ' t w a n t t o g ob a c k t o s i l e n t fi lm s , n o t b e c a u s e t h e y ' r e l az y b u t b e c a u s et h e y k n o w i t i s q u i t e p o s s i b l e t o m a k e b e a u t i f u l m o v i e su s i n g t h e i m p r o v e d t e c h n o l o g y . T h e f o r m o f th e i r a r th a s c h a n g e d , b u t t h e r e is st il l p l e n t y o f r o o m f o r a r t is t r y .

    H o w d i d t h e y d e v e l o p t h e i r s k i l l ? T h e b e s t f i l mCom munications Decem ber 1974of Volume 17the ACM Numb er 12

  • 7/30/2019 a1974-knuth_2

    6/7

    m a k e r s t h r o u g h t h e y e a r s u s u a l l y s e e m t o h a v e l e a r n e dt h e i r a r t in c o m p a r a t i v e l y p r i m i t i v e c i rc u m s t a n c e s , o f te ni n o t h e r c o u n t r i e s w i t h a l i m i t e d m o v i e i n d u s t r y . A n di n r e c e n t y e a r s t h e m o s t i m p o r t a n t t h i n g s w e h a v e b e e nl e a r n i n g a b o u t p r o g r a m m i n g s e e m t o h a v e o r i g i n a t e dw i t h p e o p l e w h o d i d n o t h a v e a c c e s s t o v e r y l a r g ec o m p u t e r s . T h e m o r a l o f t h i s s to ry , i t s eem s t o m e , i s" th a t w e s h o u l d m a k e u s e o f th e i d e a o f" l i m i t e d r e s o u r c e si n o u r o w n e d u c a t i o n . W e c a n a l l b e n e f i t b y d o i n go c c a s i o n a l " t o y " p r o g r a m s , w h e n a r t i f i c i a l r e s t r i c t i o n sa r e s e t u p , s o t h a t w e a r e f o r c e d t o p u s h o u r a b i l i t i e st o t h e l i m i t . W e s h o u l d n ' t l i v e i n th e l a p o f l u x u r y a llt h e t i m e , s i n c e t h a t t e n d s t o m a k e u s l e t h a r g i c . T h e a r to f t a c k l i n g m i n i p r o b l e m s w i t h a ll o u r e n e r g y w i lls h a r p e n o u r t a l e n t s f o r t h e r e a l p r o b l e m s , a n d t h ee x p e r i e n c e w i l l h e l p u s t o g e t m o r e p l e a s u r e F r o m o u ra c c o m p l i s h m e n t s o n l e s s r e s t r i c t e d e q u i p m e n t .

    i n a s i m i l a r v e i n , w e s h o u l d n ' t s h y a w a y F r o m " a r tf o r a r t' s s a k e " ; w e s h o u l d n ' t f e d g u i l ty a b o u t p r o g r a m st h a t a r e j u s t f o r f u n . I o n c e g o t a g r e a t k i c k o u t o f"w r i t in g a o n e - s t a t e m e n t A LG O L p r o g r a m t h a t i n v o k e da n i n n e r p r o d u c t p r o c e d u r e i n s u c h a n u n u s u a l w a y t h a ti t c a l c u l a t e d t h e r u th p r i m e n u m b e r , i n s t e a d o f ani n n e r p r o d u c t [ 19 ]. S o m e y e a r s a g o t h e s t u d e n ts a tS t a n f o r d w e r e e x c i t e d a b o u t f i n d i n g t h e s h o r t e s t ~ O R -T RA N p r o g r a m w h i c h p r i n t s i t s e l f o u t , i n t h e s e n s e t h a tt h e p r o g r a m ' s o u t p u t i s i d e n t ic a l t o i t s o w n s o u r c e t ex t .T h e s a m e p r o b l e m w a s c o n s i d e re d f o r m a n y o t h e rl a n g u a g e s . I d o n ' t t h i n k i t w a s a w a s t e o f ti m e f o r t h e mt o w o r k o n t h i s ; n o r w o u l d J e r e m y B e n t h a m , w h o m tq u o t e d e a r l ie r , d e n y t h e " u t i l i t y " o f s u c h p a s t i m e s [ 3,B k . 3 , C h . 1 ]. " O n t h e c o n t r a r y , " h e w r o t e , " t h e r e i sn o t h i n g , t h e u t i l i t y o f w h i c h i s m o r e i n c o n t e s t a b l e .T o w h a t s h a l l t h e c h a r a c t e r o f u ti l it y b e a s c r ib e d , i fn o t t o t h a t w h i c h i s a s o u r c e o f p l e a s u r e ? "Providing Beautiful Tools

    A n o t h e r c h a r a c t e r i s t i c o f m o d e r n a r t is i ts e m p h a s i so n c r e a t i v i t y . I t s e e m s t h a t m a n y a r t i s t s t h e s e d a y sc o u l d n ' t c a r e l e s s a b o u t c r e a t i n g b e a u t i f u l t h i n g s ; o n l yt h e n o v e l t y o f a n id e a i s i m p o r t a n t . I ' m n o t r e c o m -m e n d i n g t h a t c o m p u t e r p r o g r a m m i n g s h o u l d b e l ik em o d e r n a r t i n t h i s s e n s e , b u t i t d o e s l e a d m e t o a no b s e r v a t i o n t h a t I th i n k i s i m p o r t a n t . S o m e t i m e s w ea r e a ss i g n e d t o a p r o g r a m m i n g t a s k w h i c h i s a l m o s th o p e l e s s l y d u l l , g i v i n g u s n o o u t l e t w h a t s o e v e r f o r a n yc r e a t i v i t y ; a n d a t s u c h t i m e s a p e r s o n m i g h t w e l l c o m et o m e a n d s a y , " S o p r o g r a m m i n g i s b e a u t i f u l ? I t ' s a l lv e r y w e ll f b r y o u t o d e c l a i m t h a t I s h o u l d t a k e p l e a s u r ei n c r e a t i n g e I e g a n t a n d c h a r m i n g p r o g r a m s , b u t h o wa m i s u p p o s e d t o m a k e t h is m e s s i n to a w o r k o f a r t ? "67 2

    W e l t , i t ' s t r u e , n o t a l l p r o g r a m m i n g t u s k s a r e g o i n gt o be f u n . C o n s i d e r t h e " t r a p p e d h o u s e w i R , , " w h o h a st o c le a n o f f t h e s a m e t a b l e e v e r y d a y : t h e r e ' s n o t r o o mf 'o r c r e a t i v i t y o r a r t i s t r y i n e ~ e r y s i t u a t i o n . B u t e v e n i ns u c h c a s e s, t h e r e i s a w a y t o m a k e a :) g i m p r o v e m e n t :i t i s s ti ll a p l e a s u r e t o d o r o u t i n e . i o b s it" w e h a v e b e a u -t i fu l t h ings t o w o r k w i t h . F o r e x a ~ n p l e , a p e r s o n w i l lr e a l l y e n j o y w i p i n g o ff " t h e d i n i n g r o om t a b l e , d a y a f t e rd a y , i f' i t i s a b e a u t i f u l l y d e s ig ~ l cd r u b l e m a d e f r o m s o m ef i n e q u a l i t y h a r d w o o d .

    T h e r e f' o re 1 w a r lt t o a d d r e s s m y c l o s i n g r e m a r k s t ot he s y st e m p r o g r a m m e r s a n d t h e m a c M n e d e s i g ne r s w h op r o d u c e t h e s y s t e m s t h a t th e r c s t o f u s m u s t w o r k w i th .. P / eas ' e , g ive us t oo l s t ha t a r e a p l easu re t o use , e spec i a l l yf o r o u r r o u d n e a s s i g n m e n t s , i n s t e a d o f p r o v i d i n g s o m e -t h i n g w e h a v e t o f i g h t w i t h . P l e a s e . g i v e u s t o o l s t h a te n c o u r a g e u s t o w r i te b e t t e r p r o g r a m s b y e n h a n c i n go u r p l e a s u r e w h e n w e d o s o .

    I t ' s v e r y h a r d f o r m e t o c o n v i n c e c o l l e g e f l e s h m e nt h a t p r o g r a m m i n g i s b e a u t i f u l , w h e n t h e f ir s t t h i n g Ih a v e t o t el l t h e m i s h o w t o p u n c h " s h ~ s lh s l a s h JO Be q u a l s s o - a n d - s o . " E v e n j o b c o n t r o l l a n g u a g e s c a n bed e s i g n e d s o t h a t t h e y a r e a p l e a s u r e t o u s e , in s t e a d o fb e i n g s t r i c t l y f u n c t i o n a l .

    C o m p u t e r h a r d w a r e d e s i g n e r s c a n m a k e t h e i r m a -c h i n es m u c h m o r e p l e a s a n t t o u s e , { ' o r e x a m p t e b yp r o v i d i n g f l o a t i n g - p o i n t a r i t h m e t i c w h i c h s a t i s f i e s s i m -p l e m a t h e m a t i c a l l aw s . T h e f a c i l it i e s p r e s e n t l y a v a i l a b l eo n m o s t m a c h i n e s m a k e t h e j o b o f r ig o r o u s e r r o ra n a l y s i s h o p e l e s s l y d i f f i c u l t , b u t p r o p e r l y d e s i g n e do p e r a t i o n s w o u ld e n c o u r a g e n u m e r i c a l a n a l y s ts t op r o v i d e b e t t e r s u b r o u t i n e s w h i c h h a v e c e r t if i e d a c c u r a c y(cf. [20, p. 204]).L e t ' s c o n s id e r a l s o w h a t s o f t w a r e d e s i g n e r s c a n d o .O n e o f t h e b e s t w a y s t o k e e p u p t h e s p i r i t s o f a s y s t e mu s e r i s t o p r o v i d e r o u t i n e s t h a t he c a n i n t e r a c t w i t h .W e s h o u l d n ' t m a k e s y s t e m s t o o a u t o m a t i c , s o th a t th ea c t i o n a l w a y s g o e s o n b e h i n d t h e s c e n e s ; w e o u g h t t og i v e t h e p r o g r a m m e r - u s e r a c h a n c e t o d i r e c t h is c r e a -t i v i ty i n t o u s e f u l c h a n n e l s . O n e t h i n g a l l p r o g r a m r n e r sh a v e in c o m m o n i s t h a t t h e y e n j o y w o r k i n g w i t h m a -c h i n e s ; s o l e t ' s k e e p t h e m i r a t h e l o op . S o m e t a s k s a r eb e s t d o n e b y m a c h i n e , w h i le o t h e r s a r e b e s t d o n e b yh u m a n i n s i g h t ; a n d a p r o p e r l y d e s i g n e d s y s t e m w i l l f i n dt h e ri g h t b a l a n c e . ( I h a v e b e e n t r y i n g t o a v o i d m i s-d i r e c te d a u t o m a t i o n f o r m a n y y e a r s , c f. [ 1 8] ,)

    P r o g r a m m e a s u r e m e n t t o o ls m a k e a g o o d c as e inp o i n t . F o r y e a r s , p r o g r a m m e r s h a v e h e e l ] u n a w a r e o fh o w t h e r e a l c o s t s o f c o m p u t i n g a r e d i s t r ib u t e c i i n th e irp r o g r a r n s . E x p e r i e n c e i n d i c a t e s t h a t n e a r l y e v e r y b o d yh a s th e w r o n g i d e a a b o u t t h e r e a l b o t t l e n e c k s i n h isComrnuaicatiorns Decem ber 1974of' Volum e 17the ACM Num[x:r /2

  • 7/30/2019 a1974-knuth_2

    7/7

    p r o g r a m s ; i t i s n o w o n d e r t h a t a t t e m p t s a t ef fi c ie n c yg o a w r y s o o f te n , w h e n a p r o g r a m m e r i s n e v e r g iv e n ab r e a k d o w n o f c o st s a c c o r d i n g t o t h e l i n es o f c o d e h eh a s w r i t t e n . H i s j o b i s s o m e t h i n g E k e t h a t o f a n e w l ym a r r i e d c o u p l e w h o t r y t o p l a n a b a l a n c e d b u d g e tw i t h o u t k n o w i n g h o w m u c h t h e i n d i v id u a l i t e m s li k ef o o d , s h e l t e r , a n d c l o t h i n g w i ll c o s t . A l l th a t w e h a v eb e e n g i v i n g p r o g r a m m e r s i s a n o p t i m i z i n g c o m p i l e r ,w h i c h n ~ y s t er i o us l y d o e s s o m e t h i n g t o th e p r o g r a m s i tt r a n s l a t e s b u t w h i c h n e v e r e x p l a i n s w h a t it d o e s . F o r -t u n a t e l y w e a r e n o w f i n a lI y s e e i n g t h e a p p e a r a n c e o fs y s t e m s w h i c h g i v e t h e u s e r c r e d i t f o r s o m e i n t e l l bg e n c e ; t h ey a u t o m a t i c a l l y p r o v i d e i n s t r u m e n t a t i o n o fp r o g r a m s a n d a p p r o p r i a t e f e e d b a c k a b o u t th e r e alc o s t s . T h e s e e x p e r i m e n t a l s y s t e m s h a v e b e e n a h u g es u c c e ss , b e c a u s e t h e y p r o d u c e m e a s u r a b l e i m p r o v e -m e a t s , a n d e s p e c i a l l y b e c a u s e t h e y a r e f un t o u s e, s o la m c o n f i d e n t t h a t i t i s o n l y a m a t t e r o f t im e b e f o r e t h eu s e o f s u c h s y s t e m s i s s t a n d a r d o p e r a t i n g p r o c e d u r e .M y p a p e r in C o m p u t i t T g S u r v e y s [ 2 1 ] d i s c u s s e s t h i s f u r -t h e r , a n d p r e s e n t s s o m e i d e a s f o r o t h e r w a y s i n w h i c ha n a p p r o p r i a t e i n t e r a c t i v e ro u t i n e c a n e n h a n c e t h es a t i sf ' a ct i o n o f u s e r p r o g r a m m e r s .

    L a n g u a g e d e s i g n e r s a ls o h av e a n o b l i g a t i o n top r o v i d e l a n g u a g e s t h a t e n c o u r a g e g o o d s t y le , s i nc e w ea l l k n o w t h a t s t y l e is s t r o n g l y i n f l u e n c e d b y t h e l a n g u a g ei n w h i c h i t is e x p r e s s e d . T h e p r e s e n t s t t rg e o f i n t e r e s tira s t r u c t u r e d p r o g r a m m i n g h a s r e v e a l e d t h a t n o n e o fo u r e x i s t i n g l a n g u a g e s i s r e a l l y id e a l f or d e a l i n g w i t hp r o g r a m a n d d a t a s t r u c tu r e , n o r i s i t c l e ar w h a t a ni d e a l l a n g u a g e s h o u l d b e . T h e r e f o r e 1 l o o k f o r w a r d t om a n y c a r e f u l e x p e r i m e n t s i n la n g u a g e d e s ig n d u r i n gt h e n e x t f ew y e a r s .S u m m a r y

    T o s u m m a r i z e : W e h a ve se e n t h a t c o m p u t e r p r o -g r a m m i n g i s a n a r t , b e c a u se i t a p p li e s a c c u m u l a t e dk n o w l e d g e t o t h e w o r l d , b e c a u s e i t r e q u ir e s s k il l a n di n g e n u i t y , a n d e s p e c i a ll y b e c a u se i t p ro d u c e s o b j e c t s o fb e a t l t y . A p r o g r a m m e r w h o s u b c o n s c io u s l y v i e w s h i m -s e l f a s a n a r t i s t w i l l e n j o y w h a t h e d o e s a n d w i l l d o i tb e t t e r . T h e r e f o r e w e c a n b e g l a d t h a t p e o p l e w h o l e c-t u r e a t c o m p u t e r c o n f e r e n c e s s p e a k a b o u t t h e s t a t e o ft h e A r t .

    References1. Bailey, Nath an. The Universal Etymological English Dictionary.T. C ox , London , 1727. See "Ar t , " "L ibe ra l , " and "Sc ience ."2. Bauer, Wa lter F ,, Juncosa, Ma rio L. , and Peri ls, Alan J .AC M pub l ica t ion po l ic ie s and p lans . J . A C M 6 (Apr. 1959),121-122.3 . Bentham, Jeremy. The Rationale o f Reward. Trans. fromThdorie des peiltes et des rdcom penses, t811, by Richard Smith ,J . & H. L . Hun t , London , 1825 .

    4 . The Cetm~ry Dictiotlary a td Cyclopedia 1. The Century Co. ,New York, I889.5 . Clementi , Muz [o. The Art of Playing the Piano. Trans. fromL'art de ]ouer le pianq/brte by Max Vogrich. Schirmer, New York,1898.6 . Colvin , S idney. "A rt? ' Eircyclopaedia Britatmica, eds 9, 11,12, 13, 1875-1926.7. Coxeter, H. S. M. Convocation address, Proc. 4th Ca nad ianMath. Congress, 1957, pp. 8-40.8 , Dijkstra , Edsger W. EWD 316: A Short l~rtrodaction to the Art02/ Progra mmit~g. T. H. Eindhoven, The Netherlands, Aug. 1971.9. Ershov, A. P . Aesthetics and the hum an factor in programming.C o m m . A C M 1 5 (July 1972), 501--505.10. Fielden, Thomas. The Science o/" Piano/brte Technique.Macmillan, London, 1927.11. G ore, George. 771e Ar t o f Scientific Dis'covery. Longmans,Green, London, 1878.12. H amilton , Will iam. Lectures on Logic 1. Wrn. Blackwood,Edinburgh, 1874.13. Hodges, John A. Elementary Photography: The "AmateurPhotographer" Library 7. Lond on, 1893. Sixth ed, revised andenlarge d, 1907, p. 58.14. Howard, C. Frusher. Howard 's Art of Computation an dgolden rule for equation of payments for schools, business collegesand seligculture . . . . C.F. Howard, San Francisco, 1879.15. Hummel, J.N. 17re Ar t o/" Playing the P iano Forte. Boosey,London, 1827.16. Kernighan B .W., and Plauger, P .J . The E lemen ts oJ" Program-milrg Style. McGraw-Hill, New York, 1974.17. Kirwan, Richard. Eleme,Tts o/" Mineralogy. Elmsly, London,1784.18. Knuth, Donald E. Minimizing drum latency t ime. J . A C M 8(Apr. 1961), 119-150.19. Knuth , Don ald E. , and Merner, J .N. AL GO L 60 confidentia l .C o mm . A C M 4 (Jane 1961), 268--272.20. Knuth, Donald E. Seminumerical Algori thms: The Art o/"Computer Programming 2 . Addison-Wesley, Reading, Mass., 1969.21. Knu th, Don ald E. Structured programm ing with go to s ta te-ments . Computbrg Surveys 6 (Dec . 1974), pages in makeup.22. Kochevitsky, George. The Art o f Piano Plwing: A Scient i f icApproach. Summ y-Birchard, Evanston, II1., 1967.233. Lehmer, Emma. Number theory on the SWAC. Proc. Syrup.Applied Math. 6, Amer. Math. Soc. (1956), 103-108.24. Mahesh Yogi, Maharishi. The Science q/ 'Being and Art q fLiving. Allen & Unwin, London, 1963.25. Malevinsky, Moses L. The Science of Playwriting. Bren tano ' s ,New York, 1925.26. Manna, Z ohar, and Pnueli, Am ir. Formalization of propert iesof functional programs, d . A C M 1 7 (July t970), 555-.569.27. Marc kwardt, Albert H. Preface to lqmk and Wagnall 's Stan-dard Colh, ge D ictionary. Harcour t , B race & W or ld , New Y ork ,1963, vii.28. Mill , John Stuart . A S ystem off Logic, Ratiocinative andbrductive. Lond on, 1843. The quotations are from the in troduction,2, and from Book 6, Chap. 11 (12 in later editions), 5.29. Mueller , Rob ert E. The Science o f Art . John Day , New Y ork ,1967.30. Parsons, A lbert Ross. The Science of Piano/brte Practice.Scbirme r, New York, 1886.31. Pedoe, Daniel . The Gent le Art o f Mathem at ics . English U.Press , London, 1953.32. Ruskin , John. The Stones o f Venice 3 . London, 1853.33. Salton,. G. A. Personal comm unication, June 21, 1974.34. Snow, C.P. The two cultures. The New Sta tesman and Nat ion5 2 (Oct. 6, 1956), 413-414.35. Snow, C.P. The Two Cultures: and a Seco nd Look . C a m b r i d g eUniversity Press, 1964.

    67 3 Comm unica t ions December 1974of Volume 17t h e A C M N u m b e r 1 2