Up Next

Chapter 0  Preface

The strange history of this book

In January 1999 I was preparing to teach an introductory programming class in Java. I had taught it three times and I was getting frustrated. The failure rate in the class was too high and even for students who succeeded, the overall level of achievement was too low.

One of the problems I saw was the books. I had tried three different books (and read a dozen more), and they all had the same problems. They were too big, with too much unnecessary detail about Java, and not enough high-level guidance about how to program. And they all suffered from the trap door effect: they would start out very gradual and easy, and then somewhere around Chapter 5, the bottom would fall out. The students would get too much new material, too fast, and I would spend the rest of the semester picking up the pieces.

Two weeks before the first day of classes, I decided to write my own book. I wrote one 10-page chapter a day for 13 days. I made some revisions on Day 14 and then sent it out to be photocopied.

My goals were:

I needed a title, so on a whim I chose How to Think Like a Computer Scientist.

My first version was rough, but it worked. Students did the reading, and they understood enough that I could spend class time on the hard topics, the interesting topics and (most important) letting the students practice.

As a user and advocate of free software, I believe in the idea Benjamin Franklin expressed:

“As we enjoy great Advantages from the Inventions of others, we should be glad of an Opportunity to serve others by any Invention of ours, and this we should do freely and generously.”

So I released the book under the GNU Free Documenation License, which allows users to copy, modify, and distribute the book.

What happened next is the cool part. Jeff Elkner, a high school teacher in Virginia, adopted my book and translated it into Python. He sent me a copy of his translation, and I had the unusual experience of learning Python by reading my own book.

Jeff and I revised the book, incorporated a case study by Chris Meyers, and released How to Think Like a Computer Scientist: Learning with Python, also under the GNU Free Documenation License.

At the same time, my wife and I started Green Tea Press, which distributes several of my books electronically, and sells How to Think in hard copy.

I have been teaching with this book for more than five years now, and I have done a lot more Python programming. I still like the structure of the book, but for some time I have felt the need to make changes:

At the same time, Jeff has been working on his own second edition, customized for his classes. Rather than cram everything into one book (which may be how other books got so big), we decided to work on different versions. They are both under the Free Documentation License, so users can choose one or combine material from both.

For my version, I am using the revised title How to Think Like a (Python) Programmer. This is a more modest goal than the original, but it might be more accurate.

Allen B. Downey
Needham MA
Allen Downey is a Professor of Computer Science at the Franklin W. Olin College of Engineering.

For the teacher

Swampy and UML

For the student

Try out examples.

Do the in-chapter examples.

Where to get the code.

Contributor List

To paraphrase the philosophy of the Free Software Foundation, this book is free like free speech, but not necessarily free like free pizza. It came about because of a collaboration that would not have been possible without the GNU Free Documentation License. So we thank the Free Software Foundation for developing this license and, of course, making it available to us.

We also thank the more than 100 sharp-eyed and thoughtful readers who have sent us suggestions and corrections over the past few years. In the spirit of free software, we decided to express our gratitude in the form of a contributor list. Unfortunately, this list is not complete, but we are doing our best to keep it up to date.

If you have a chance to look through the list, you should realize that each person here has spared you and all subsequent readers from the confusion of a technical error or a less-than-transparent explanation, just by sending us a note.

Impossible as it may seem after so many corrections, there may still be errors in this book. If you should stumble across one, please check the online version of the book at http://thinkpython.com, which is the most up-to-date version. If the error has not been corrected, please take a minute to send us email at feedback@thinkpython.com. If we make a change due to your suggestion, you will appear in the next version of the contributor list (unless you ask to be omitted). Thank you!


Up Next