140 likes | 253 Views
Where are we in class right now?. Finished chapter 5 and getting ready to start chapter 6 Between “algorithms” and “programming” Great time to revisit the nature of computer programming. Bibliography. Donald Knuth’s ACM Turing Award Lecture. Interview with Knuth. From a radio series on art…
E N D
Where are we in class right now? • Finished chapter 5 and getting ready to start chapter 6 • Between “algorithms” and “programming” • Great time to revisit the nature of computer programming
Bibliography • Donald Knuth’s ACM Turing Award Lecture
Interview with Knuth • From a radio series on art… • http://www.npr.org/templates/story/story.php?storyId=4532247
Selected quotes • “If computer programming is to become an important part of computer research and development, a transition of programming from an art to a disciplined science must be effected.” • “first steps toward transforming the art of programming into a science”
“Art” vs “Science” • Tend to separate • College of Arts and Sciences • B.A. or B.S. • Original seven liberal arts • grammar, rhetoric, logic, arithmetic, geometry, music, and astronomy • Latin • ars, artis meaning “skill”
One characterization • “Science” • “Knowledge which has been logically arranged and systemized in the form of ‘general laws’ ” • “Science is knowledge which we understand so well that we can teach it to a computer; and if we don’t fully understand something, it is an art to deal with it.”
“Art” and “Science” • “It was once thought that the imaginative outlook of the artist was death for the scientist. And the logic of science seemed to spell doom to all possible artistic flights of fancy.” • In truth, there are advantages that results from a synthesis of science and art.
“Art” and “Science” • Computer programming is both a science and an art. One complements the other. • “The making of a dictionary is both a science and an art.” • “The science without art is likely to be ineffective; the art without science is certain to be inaccurate.”
Learning to program • Most of what you learn about programming in the classroom is the science side of it. • Raw knowledge • Language, data structures, algorithms • But this does not make you a good programmer!
Learning to program • The “science” of programming is necessary but not sufficient. • Just like in writing, the “art” is learned by practicing, by seeing how others have done things, and by exploring alternatives. • So, seek out opportunities • Find tutorials on web that are fun to you! • Look for examples online • It takes practice to recognize good examples and bad examples • Learn new languages
From Knuth • “My feeling is that when we prepare a program, it can be like composing poetry or music… programming can give us both intellectual and emotional satisfaction… when we read other people’s programs we can recognize them as genuine works of art.” • “The possibility of writing beautiful programs, even in assembly language, is what got me hooked on programming in the first place.”
Beauty • Eye of the beholder • Develop personal style • What makes a program “good” or “bad”? • Correctness • Maintainability (easy to read and change) • Interacts well with users (HCI) • Efficiency • You don’t get there in a single step! • Revise (refactor)
Disclaimer on “efficiency” • It is important, but… • Optimize (focus on efficiency) at the end. • Get it working first! • “… programmers have spent far too much time worrying about efficiency in the wrong places and at the wrong times; premature optimization is the root of all evil (or at least most of it) in programming.”
Evolution of the concept of “art” • Once, it appears, that “art” was basically same as “science” • A distinction developed, “science” as codified knowledge and “art” as the application of the knowledge • Now, we might say (overly simplified) that “science” provides basic knowledge, “engineering” is knowledge of how to apply that knowledge, and “art” applies to the application of intuitive or creative skills within a domain. • Good computer programming uses them all.