How to Think Like a Computer Scientist: Learning with Python 3
Documentation, Release 3rd Edition
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.
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.
0.0.2 Finding a textbook
Having decided to use Python in both of my introductory computer science classes the follow-
ing 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.
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.
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.
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 Com-
munity 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.
vi CONTENTS