2010. 2. 2. 22:26

파이썬으로 공부하는 과학자처럼 생각하기 2판 - 서문


원문 주소: http://openbookproject.net/thinkCSpy/preface.html

Preface
By Jeffrey Elkner
서문 - 제프레이 엘크너
 
This book owes its existence to the collaboration made possible by the Internet and the free software movement. Its three authors—a college professor, a high school teacher, and a professional programmer—never met face to face to work on it, but we have been able to collaborate closely, aided by many other folks who have taken the time and energy to send us their feedback.
 
이 책은 인터넷과 자유 소프트웨어 운동으로 인해 가능했었던 협력들 덕분에 만들어진 결과물 입니다. 세 분의 저자분 - 대학교수, 고등학교 교사, 전문적인 프로그래머 - 들은 한번도 얼굴을 맞대며 작업하지 않았지만, 아주 밀접하게 협력할 수 있었으며, 또한 여러 많은분들의 열정적으로 시간과 에너지를 쏟으면서 보여준 의견교환(피드백)들이 도움이 되었습니다.

We think this book is a testament to the benefits and future possibilities of this kind of collaboration, the framework for which has been put in place by Richard Stallman and the Free Software Foundation.

우리는 리처드 스톨만과 자유 소프트웨어 제단이 만든 틀안에서 가능했던 이러한 협업의 이익들과 미래 가능성의 증거들이 이 책에 담겨 있다고 생각합니다.

How and why I came to use Python
어떻게 그리고 왜 제가 파이썬을 사용하게 되었는가

In 1999, the College Board’s Advanced Placement (AP) Computer Science exam was given in C++ for the first time. As in many high schools throughout the country, the decision to change languages had a direct impact on the computer science curriculum at Yorktown High School in Arlington, Virginia, where I teach. Up to this point, Pascal was the language of instruction in both our first-year and AP courses. In keeping with past practice of giving students two years of exposure to the same language, we made the decision to switch to C++ in the first year course for the 1997-98 school year so that we would be in step with the College Board’s change for the AP course the following year.

1999년, 미국대학위원회의 대학과목선이수제(AP) 컴퓨터 사이언스 과목시험이 처음으로 C++ 으로 주어졌습니다. 미국내 많은 고등학교들이 그러했던거처럼, 제가 가르치고 있는 버지니아주 알링턴시에 있는 요크타운 고등학교의 컴퓨터 사이언스 과목이 직접적인 타격을 받았습니다. 그때까지는 파스칼(Pascal)이 1학년과 AP 수업 모두를 대상으로 한 교육언어로 사용되고 있었습니다. 2년동안 학생들에게 같은 언어로 꾸준히 가르치고 있던 도중, 우리는 1997-98 학년도에 입학한 1학년들을 대상으로 다음해 미국대학위원회의 AP 수업의 변화에 맞추기 위한 과정으로 가르치는 언어를 C++ 로 변경하기로 결정했습니다.

Two years later, I was convinced that C++ was a poor choice to use for introducing students to computer science. While it is certainly a very powerful programming language, it is also an extremely difficult language to learn and teach. I found myself constantly fighting with C++’s difficult syntax and multiple ways of doing things, and I was losing many students unnecessarily as a result. Convinced there had to be a better language choice for our first-year class, I went looking for an alternative to C++.

2년이 지나고 난뒤, 전 C++ 가 학생들에게 컴퓨터 사이언스를 소개하기엔 부족하다는 것을 확인할 수 있었습니다. 아주 강력한 프로그래밍 언어이지만, 가르치거나 배우기엔 상당히 어렵습니다. 저 자신이 뭔가할 때 수 많은 문법과 진행방향에서 지속적인 어려움을 겪었으며, 불필요하게 많은 학생들을 학습과정을 따라오지 못했습니다. 1학년 학생들에게 더 좋은 언어의 선택이 있을꺼라 확신한 전, C++ 의 대안을 찾기 시작했습니다.

I needed a language that would run on the machines in our GNU/Linux lab as well as on the Windows and Macintosh platforms most students have at home. I wanted it to be free software, so that students could use it at home regardless of their income. I wanted a language that was used by professional programmers, and one that had an active developer community around it. It had to support both procedural and object-oriented programming. And most importantly, it had to be easy to learn and teach. When I investigated the choices with these goals in mind, Python stood out as the best candidate for the job.

전 우리의 GNU/리눅스 연구실에서 동작하는 것과 동시에 대부분의 학생들이 가정에서 사용하는 윈도우나 맥킨토시 플랫폼에도 동작하는 언어가 필요했습니다. 학생들의 가정 재정수준과 관계 없이 사용 할 수있게, 무료로 제공되는 것을 원했습니다. 전문 프로그래머들이 사용하고, 적극적인 개발자 커뮤니티가 활성화되어 있는 언어를 원했습니다. 그리고 절차적, 객체-지향적 프로그래밍이 지원되야 했습니다. 그리고 가장 중요한 것은 배우기가 쉬워야 했습니다. 제가 이러한 목적들을 마음에 두고 선택지들을 조사했을 때, 파이썬이 제가 원하는 것에 맞는 최고 후보자로 남아 있었습니다.

I asked one of Yorktown’s talented students, Matt Ahrens, to give Python a try. In two months he not only learned the language but wrote an application called pyTicket that enabled our staff to report technology problems via the Web. I knew that Matt could not have finished an application of that scale in so short a time in C++, and this accomplishment, combined with Matt’s positive assessment of Python, suggested that Python was the solution I was looking for.

요크타운의 재능있는 학생들중 한 명인 매트 알랜스에게 파이썬을 주고 한번 사용해보라고 요청해 보았습니다. 두 달만에 그는 그 언어를 습득했을 뿐만 아니라, 우리 직원들이 웹을 통해 기술 문제들을 보고하는 pyTicket 이라고 하는 응용프로그램을 만들기까지 했습니다. 매트가 아마 C++ 로 그 정도 규모의 프로그램을 그 짧은 시간 안에 만들어라고 했다면 하지 못했을 것입니다. 매트의 파이썬에 관한 긍정적인 평과와 더불어 파이썬이 이제껏 제가 찾아 왔던 해답이라고 생각하게 되었습니다.

Finding a textbook
교과서 찾기

Having decided to use Python in both of my introductory computer science classes the following year, the most pressing problem was the lack of an available textbook.

파이썬을 제 컴퓨터 사이언스 수업의 입문자들과 다음학년 학생들에게 모두 사용하기로 결정했을 때, 겪었던 가장 큰 문제점이 교과서가 부족하다는 것이였습니다.

Free documents came to the rescue. Earlier in the year, Richard Stallman had introduced me to Allen Downey. Both of us had written to Richard expressing an interest in developing free educational materials. Allen had already written a first-year computer science textbook, How to Think Like a Computer Scientist. When I read this book, I knew immediately that I wanted to use it in my class. It was the clearest and most helpful computer science text I had seen. It emphasized the processes of thought involved in programming rather than the features of a particular language. Reading it immediately made me a better teacher.

무료 문서들이 저를 살렸습니다. 시작하기 연초에, 리처드 스톨만이 저에게 앨런 다운웨이 분을 소개했습니다. 우리 모두 리처드가 제안하는 무료 교육교재 개발에 관심이 있었습니다. 앨런은 이미 1학년 컴퓨터 사이언스 책인, 컴퓨터 과학자처럼 생각하기 라는 책을 저술했습니다. 제가 그 책을 읽었을 때, 바로 이 책을 제 수업에 사용하기를 원했다는 것이 기억납니다. 여지껏 봐왔던 컴퓨터 사이언스 책들 중에 가장 명확하고 도움이 되었습니다. 이 책은 특정 언어의 특징들 보다는 프로그래밍을 통한 생각하는 과정을 강조한 책입니다. 이 책을 읽음으로 전 더 좋은 선생이 되었습니다.

How to Think Like a Computer Scientist was not just an excellent book, but it had been released under the GNU public license, which meant it could be used freely and modified to meet the needs of its user. Once I decided to use Python, it occurred to me that I could translate Allen’s original Java version of the book into the new language. While I would not have been able to write a textbook on my own, having Allen’s book to work from made it possible for me to do so, at the same time demonstrating that the cooperative development model used so well in software could also work for educational materials.

컴퓨터 과학자처럼 생각하기 라는 책은 단순히 훌륭한 책만이 아니라, 사용자들의 원하는 수준에 맞게 자유롭게 수정되고 사용될 수 있는 GNU 출판 라이선스로 공개되어 있었습니다. (이러한 공개조건이 되어) 파이썬을 사용하기로 결정했었기에, 전 앨런의 원래 책에 나와 있던 자바 버전을 새로운 언어로 변환할 수 있었습니다. 제 자신이 교과서를 쓸 능력이 없었기에, 앨런의 책이 그 작업을 가능하게 했습니다. 동시에 협력 개발 모델이 소프트웨어에 잘 적용되어 교육교재개발 작업에 효과를 줄수 있었습니다.

Working on this book for the last two years has been rewarding for both my students and me, and my students played a big part in the process. Since I could make instant changes whenever someone found a spelling error or difficult passage, I encouraged them to look for mistakes in the book by giving them a bonus point each time they made a suggestion that resulted in a change in the text. This had the double benefit of encouraging them to read the text more carefully and of getting the text thoroughly reviewed by its most important critics, students using it to learn computer science.

최근 2년동안 이 책으로 일하면서 학생들과 저에게 많은 도움이 되었으며, 제 학생들이 이 작업에 큰 부분을 차지했습니다. 누군가가 문장이 어렵다거나 오타를 발견하면 즉시 수정할 수 있었기에, 그들에게 매번 제안을 할때마다 보너스 점수를 주면서 격려했으며, 그 결과가 이 책을 변화시켰습니다. 이는 컴퓨터 사이언스를 공부하는데 이 책을 사용하면서 학생들이 더욱 주의깊게 읽고 신중하면서도 중요한 비평들로 리뷰하는 하는 이중 이득을 얻을 수 있었습니다.

For the second half of the book on object-oriented programming, I knew that someone with more real programming experience than I had would be needed to do it right. The book sat in an unfinished state for the better part of a year until the open source community once again provided the needed means for its completion.

이 책의 후반부인 객체-지향 프로그래밍에 대해, 전 프로그래밍을 실제로 더 잘하시는 누군가 이를 수정하실꺼라고 알고 있습니다. 이 책은 오픈소스 커뮤니티에서 완성을 위한 요구 사항들이 만족될 때까지 한학년 부분을 더좋은 상태로 만들기 위해 미완성 상태로 남겨두었습니다.

I received an email from Chris Meyers expressing interest in the book. Chris is a professional programmer who started teaching a programming course last year using Python at Lane Community College in Eugene, Oregon. The prospect of teaching the course had led Chris to the book, and he started helping out with it immediately. By the end of the school year he had created a companion project on our Website at http://openbookproject.net called *Python for Fun* and was working with some of my most advanced students as a master teacher, guiding them beyond where I could take them.

전 '크리스 메이여스'라는 분이 이 책에 관심있다고 보낸 전자우편을 받았습니다. 크리스는 오리곤 주 유진 시에 있는 레인 커뮤니티 대학에서 지난해 파이썬을 이용한 프로그래밍을 가르치지 시작한 전문 프로그래머입니다. 이 수업을 가르칠려는 안목이 크리스를 이 책으로 인도하게 했으며, 바로 이 작업을 도와주기 시작했습니다. 그해 학년이 끝날때 쯤에, 그는  http://openbookproject.net 에 우리의 *Python for Fun* 이라는 협력 프로젝트를 개설했으며, 이곳에서 제가 가르칠 수 있는 부분을 넘어서까지 저의 몇몇 고급반 학생들이 교사로써 작업하였습니다.

Introducing programming with Python
파이썬으로 프로그래밍를 소개합니다.

The process of translating and using How to Think Like a Computer Scientist for the past two years has confirmed Python’s suitability for teaching beginning students. Python greatly simplifies programming examples and makes important programming ideas easier to teach.

컴퓨터 과학자처럼 생각하기 라는 책을 지난 2년동안 사용하며 번역 작업을 하는 동안 파이썬이 학생들에게 안정적인 교육이 될 수 있다는 것이 확인되었습니다. 파이썬은 프로그래밍의 예제들을 아주 간편하게하고, 중요한 프로그래밍 생각들을 더욱 쉽게 가르칠수 있습니다.

The first example from the text illustrates this point. It is the traditional hello, world program, which in the Java version of the book looks like this:

다음의 첫번째 예가 이러한 관점을 설명해줍니다. 전통적인 'hello world' 프로그램인데, 이 책의 자바 버전에서는 이렇게 표기가 됩니다.

 class Hello {

 

  public static void main (String[] args) {

      System.out.println ("Hello, world.");

  }

}

in the Python version it becomes:

파이썬 버전에서는 이렇게 표기됩니다. 

 print "Hello, World!"

Even though this is a trivial example, the advantages of Python stand out. Yorktown’s Computer Science I course has no prerequisites, so many of the students seeing this example are looking at their first program. Some of them are undoubtedly a little nervous, having heard that computer programming is difficult to learn. The Java version has always forced me to choose between two unsatisfying options: either to explain the class Hello, public static void main, String[] args, {, and }, statements and risk confusing or intimidating some of the students right at the start, or to tell them, Just don’t worry about all of that stuff now; we will talk about it later, and risk the same thing. The educational objectives at this point in the course are to introduce students to the idea of a programming statement and to get them to write their first program, thereby introducing them to the programming environment. The Python program has exactly what is needed to do these things, and nothing more.

이러한 간단한 예제에서도 파이썬의 장점들이 나타납니다. 요크타운의 컴퓨터 사이언스 강의에서는 먼저 배워야하는 선수조건이 없어서, 많은 학생들이 이 예제를 그들의 첫번째 문제로 보고 있습니다. 프로그래밍을 배우기 어렵다는 소리를 들었다면 몇몇 학생들은 의심할거 없이 조금 긴장하기 시작합니다. 자바 버전들을 항상 불편한 선택사항들을 놓고 저에게 이를 강요합니다. 이 두가지 선택사항은 class Hello, public static void main, String[] args, {} 구문을 일일이 설명하는 것과 혼란의 위험을 무릎쓰고 그냥 바로 시작하게 하거나 당장은 신경쓰지 않아도 될거고 나중에 이야기하자는 식의 설명방식에 관한 것입니다. 여기서 원래 학습 목적은 학생들에게 프로그래밍 구문의 기본 생각들을 소개하고, 이들에게 첫 프로그래밍을 하게 하여, 결과적으로 프로그래밍 환경을 소개하는 것입니다. 파이썬은 이들 요구사항들이 더 요구되는 거 없이 필요로 하는 것들을 정확하게 만족시킵니다.

Comparing the explanatory text of the program in each version of the book further illustrates what this means to the beginning student. There are seven paragraphs of explanation of Hello, world! in the Java version; in the Python version, there are only a few sentences. More importantly, the missing six paragraphs do not deal with the big ideas in computer programming but with the minutia of Java syntax. I found this same thing happening throughout the book. Whole paragraphs simply disappear from the Python version of the text because Python’s much clearer syntax renders them unnecessary.

각 버전의 교과서의 설명부분들을 비교함으로 처음 시작하는 학생들에게 이 예제가 무슨 의미인지 자세히 알수 있습니다. 'Hello, world!' 의 자바 버전에서는 7 단락들에 걸쳐서 설명이 이뤄지지만, 파이썬 버전에서는 단지 몇 문장들만으로도 충분합니다. 더 중요한 것은 나머지 6 단락들은 기본 컴퓨터 프로그래밍에 큰 생각들을 다루지 않고, 자바 문법에 세부사항에 해당한다는 것 입니다. 전 같은 것들이 이 책의 전반적으로 나타난다는 것을 발견하게 되었습니다. 전체 단락들이 파이썬의 더 분명한 문법 표현들로 인해 불필요하다고 여겨진 내용들이 그냥 사라지게 되었습니다.

Using a very high-level language like Python allows a teacher to postpone talking about low-level details of the machine until students have the background that they need to better make sense of the details. It thus creates the ability to put first things first pedagogically. One of the best examples of this is the way in which Python handles variables. In Java a variable is a name for a place that holds a value if it is a built-in type, and a reference to an object if it is not. Explaining this distinction requires a discussion of how the computer stores data. Thus, the idea of a variable is bound up with the hardware of the machine. The powerful and fundamental concept of a variable is already difficult enough for beginning students (in both computer science and algebra). Bytes and addresses do not help the matter. In Python a variable is a name that refers to a thing. This is a far more intuitive concept for beginning students and is much closer to the meaning of variable that they learned in their math courses. I had much less difficulty teaching variables this year than I did in the past, and I spent less time helping students with problems using them.

파이썬과 같은 상위-수준 언어들을 사용하면, 교사들은 학생들이 더 깊이 있는 이해에 필요한 배경지식이 필요해질 때까지 저-수준의 상세한 사항들을 미리 말하지 않고 늦출수 있습니다. 따라서 우선 처음 필요한 것들을 처음 가르칠 수 있게 할수 있는 능력을 만들어집니다. 이러한 방법으로 파이썬이 줄수 있는 가장 좋은 예제들 중에 하나는 변수들을 다루는데 있습니다. 자바에서는 내장된 형태가 있다면 할당을 위해 이름을 주어야하고, 만약 그렇지 않다면 객체를 참조하는 주소를 지정해야 합니다. 이러한 차이점을 설명할려면 컴퓨터가 어떻게 자료를 저장하는지 논의가 있어야 하므로, 컴퓨터 하드웨어의 경계까지 변수에 대한 생각하는 범위를 넓혀야 합니다. 이러한 강력하고 근본적인 변수의 개념들은 처음 배우는 학생들에겐 어려운 건 당연합니다. (컴퓨터 사이언스나 수학분야 모두 그러합니다.). 바이트나 주소는 이러한 문제를 해결하는데 도움을 주지 않습니다. 파이썬에서는 변수는 어떠한 것을 참조하는 이름입니다. 이는 처음 배우는 학생들에게 더욱 직관적인 개념으로 다가가며, 수학 과학에서 배웠던 변수라는 개념을 자바에서 배우는 것 보다 훨씬 더 가깝다고 느껴질 것입니다. 저는 과거에 변수를 가르치는 것보다 훨씬 덜 어렵다고 느끼고 있으며, 이들을 사용해서 학생들이 문제를 푸는데 드는 시간이 줄어 들었습니다.

Another example of how Python aids in the teaching and learning of programming is in its syntax for functions. My students have always had a great deal of difficulty understanding functions. The main problem centers around the difference between a function definition and a function call, and the related distinction between a parameter and an argument. Python comes to the rescue with syntax that is nothing short of beautiful. Function definitions begin with the keyword def, so I simply tell my students, When you define a function, begin with def, followed by the name of the function that you are defining; when you call a function, simply call (type) out its name. Parameters go with definitions; arguments go with calls. There are no return types, parameter types, or reference and value parameters to get in the way, so I am now able to teach functions in less than half the time that it previously took me, with better comprehension.

파이썬이 프로그래밍을 배우고 가르치는데 도움이 될 수 있는 또다른 예제로 함수의 문법들을 들수 있습니다. 제 학생들이 항상 함수를 이해하는데 엄청난 어려움을 겪고 있었습니다. 문제의 핵심은 함수를 정의하고 호출하는데에서, 그리고 파라메터와 인수와 관련된 차이점에 있었습니다. 파이썬은 단순함의 아름다움으로 이러한 문제점을 극복하는데 도움을 주었습니다. 함수 정의를 할 때 def 키워드로 시작되는 이름으로 함수를 만든 뒤에, 단순히 그 이름만 호출하면(치면) 됩니다. 파라메터들은 정의속에 들어있고, 인수는 호출과 함께 전달됩니다. 되돌리는 자료의 형식, 파라메터의 형식이나, 값과 주소의 형태가 존재하지 않고도 만들수 있으므로, 이제 전 이전에 제가 소요했던 시간보다 반이나 덜 사용하면서 더 이해하기가 쉽게 가르칠수 있게 되었습니다.

Using Python improved the effectiveness of our computer science program for all students. I saw a higher general level of success and a lower level of frustration than I experienced teaching with either C++ or Java. I moved faster with better results. More students left the course with the ability to create meaningful programs and with the positive attitude toward the experience of programming that this engenders.

파이썬을 사용함으로써 우리 컴퓨터 사이언스 프로그램을 배우는 모든 학생들의 학습효율이 향상되었습니다. 전 예전 C++ 나 자바를 가르칠때 겪었던 거보다 더 높은 일반적인 성공 수준과 낮은 좌절감의 수준을 경험하였습니다. 더 많은 학생들이 이 수업에 남아 더 의미있는 프로그램을 만들고, 이 수업이 낳은 프로그래밍의 경험하는 방향의 긍정적인 자세를 가지게 되었습니다.

Building a community
커뮤니티 만들기

I have received email from all over the globe from people using this book to learn or to teach programming. A user community has begun to emerge, and many people have been contributing to the project by sending in materials for the companion Website at http://openbookproject.net/pybiblio.

이 책을 사용하여 공부하거나 교육하는 전세계 많은 사람들로부터 전자우편을 받았습니다. 사용자 커뮤니티가 생기기 시작했으며, 협력사이트인  http://openbookproject.net/pybiblio 사이트에서 프로젝트에 도움을 주기 위한 보조 자료들을 전달하기 시작했습니다.

With the continued growth of Python, I expect the growth in the user community to continue and accelerate. The emergence of this user community and the possibility it suggests for similar collaboration among educators have been the most exciting parts of working on this project for me. By working together, we can increase the quality of materials available for our use and save valuable time. I invite you to join our community and look forward to hearing from you. Please write to me at jeff@elkner.net.

파이썬의 지속적인 성장으로, 전 이러한 사용자 커뮤니티들이 지속적이고 가속화되어 성장할 것이라 예상하고 있습니다. 이러한 사용자 커뮤니티들의 발생과 교육자들 사이의 협력 작업은 제가 하고 있는 이 프로젝트의 아주 흥미로운 부분이 되어가고 있습니다. 같이 일함으로써, 우리는 사용가능한 자료의 품질을 높이고, 귀중한 시간을 줄일 수가 있습니다. 전 당신이 우리의 커뮤니티에 참여하고 당신의 의견을 받는 것을 기대하고 있습니다jeff@elkner.net 로 연락을 주세요.

Jeffrey Elkner
Governor’s Career and Technical Academy in Arlington
Arlington, Virginia

제프리 엘크너
알링톤 주립 직업 및 기술 학교
알링톤, 버지니아 주

탐색
 
Copyright Notice
Copyright (C) Jeffrey Elkner, Allen B. Downey and Chris Meyers. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with Invariant Sections being Forward, Preface, and Contributor List, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled “GNU Free Documentation License”.
저작권 알림
저작권자 (C) 제프리 엘크너, 앨런 B. 다운웨이와 크리스 메이여스. GNU 자유 소프트웨어 제단이 발표한 GNU 자유 문서 라이선스 버전 1.3 또는 그 이후의 조건 하에 이 문서의 분배 또는/그리고 복사가 가능합니다; 변경불가 부분 : 추천사, 서문, 앞-표지문 없음, 뒷-표지문 없음. 이 라이선스의 사본은 "GNU 자유 문서 라이선스" 라는 항목으로 포함되어 있습니다.