How to Think Like a Computer Scientist: Learning with Python
Allen Downey, Franklin W. Olin College of Engineering
Jeff Elkner, Yorktown High School
Chris Meyers, Lane Community College
Pub Date: 2008
Publisher: Green Tea Press
Conditions of Use
The book provides a great introduction to Python programming. It reads at a level of a beginning programmer, though even novices should enjoy it. read more
The book provides a great introduction to Python programming. It reads at a level of a beginning programmer, though even novices should enjoy it. The basic syntax and semantics of Python are covered, including functions and objects. Some of the more advanced features are missing, and readers are encouraged to continue on to other books. Every chapter provides a glossary of new technical terms at the end. There is a comprehensive index at the end of the book.
All content was accurate. I spotted no errors and I did not feel there was any bias in the material.
The book is up to date with Python 2 syntax. Since it focuses on beginner Python, most of the concepts should not really change over time. Newer, more advanced concepts can easily be added in the future as additional chapters.
The book is very easy to read. Technical terms are introduced only when necessary and typically given via an example. Each chapter contains a glossary of new terms at the end for review.
The book is very consistently organized and presented. Most chapters read similarly to previous chapters. Terminology from prior chapters is consistently applied in later chapters.
Overall the book is modular. There are 20 chapters each around 11 pages in length. Generally, a concept is fully covered within a single chapter. The exception is the functions, which for some reason are not entirely covered within a single chapter but actually in several chapters. Overall however it should be easy to reorganize/split the reading in a course.
The organization and flow of the book is quite nice. It starts with simple concepts and slowly builds up more complex concepts. There were only a few places where I was wondering 'why is this here?' for example, when introducing the modulus operator. It felt very out of place, even though I kept reading and realized it was necessary for the chapter's examples. I also felt like the last several chapters seemed strangely out of place for the book as a whole. Almost like the authors decided to tack on a quick intro to data structures at the end.
I read the PDF version and felt the interface was about what you would expect. I was disappointed that there were not hyperlinks in the PDF to easily jump from TOC or Index directly to the page. A quick glance through the HTML version indicates it is quite usable. The HTML version seems to syntax color the code while the PDF does not for some reason.
I did not spot any issues with spelling or grammar in the book. The book has clearly had some careful proof reading.
The examples from the book should not be offensive to any particular culture.
This text covers all fundamental elements of funtional programming using python. Chapters are well structured and concise enough to be approached in read more
This text covers all fundamental elements of funtional programming using python. Chapters are well structured and concise enough to be approached in an orderly fashion.
Some challenge exists in maintaining all the examples and exercises in line with current state of the discipline. This is most notable in sections referencing the Internet which is understandable. Other than that, the text is up to date with the python functionality well described and implemented in the examples. A flag noting the recency of updates might be helpful here to better key users into possible areas of concern.
Python programming is a constantly evolving and dynamic domain. The authors are making great effors to keep the text updated with ongoing versions of the software. The text has already forked into versions for python 2 and python 3 further challenging the authors.
Appropriate terminology is used throughout the text. Concepts are introducted, described, and demonstrated in clear prose. Comments are used extensively within code segments to provide context and support comprehension and retention.
The prose is highly consistent, utilizing appropriate terms and concepts to train early programmers. Subsections on good programming practice are well distributed throughout the text, providing a regular reinforcement of behavior and structure. Chapters are kept relatively the same size, so each occupies the same timeframe within the semester. No overly long or short chapters are present making for ease of use within the weekly course calendar.
Highly modular, the chapters lend themselves to hopping around as necessary. Some chapters rely on previous work and a travelers key would be a useful addendum, identifying any clear content dependencies. Exercises are well integrated into the chapter and provide ample opportunity to practice the concepts presented.
I appreciate the outline and approach taken by the authors in covering the fundamental concepts of Python programming language. I have had difficulty in the past with the Turtle based chapters, specifically in getting the turtle modules to correctly load and execute. This presents a problem in following the text by chapter. I would prefer a forking architecture with the graphics chapters in a seperate thread which can be used or ignored as necessary. While this is nearly impossible to accomplish in a printed text I can appreciate the more linear nature of the text. But as this is now primarily available as an online resource it may be worth revisiting the strategy for presenting the material.
The authors have done a superb job to present all images in straightforward and consistent size, font, color and frame. This is particularly true with examples which can be easily cut and paste into an editor and executed to demonstrate the concepts being covered.
Syntax and grammar are consistently high and well structured. I have found no glaring grammatical errors. As programming computer syntax is a language unto itself, the authors do a good job of keeping the two separate in the textual descriptions of the concepts and implementation of python code.
The text relies on two primary cultural touchstones throughout. The first, Monty Python, is understandable in the context that the language name was chosen to honor this British comedy troop.. The second, Alice in Wonderland, is used to explore string and file manipulation. Neither is particularly relevant to the exercise and could easily be replaced by other sources of text. There are no insensitive or offensive uses of language or cultural reference to my understanding.
I have used this text as the primary course material for three years and am very satisfied with it.
This book is designed for beginning programmers, but it still useful for readers with prior programming experience. The book starts out with a read more
This book is designed for beginning programmers, but it still useful for readers with prior programming experience. The book starts out with a well-written discussion of algorithms, machine language, and other helpful foundational material for new programmers. The following chapters introduce the elements of the Python language in a thorough and comprehensive fashion. There is certainly much more that could be said about Python, but the scope seems just right for an introductory text.
I did not note any errors or issues with accuracy.
This text has been around for several years (current edition = 2008) and is a popular and widely known textbook on the Python language. The authors should be able to update it without a problem as new versions of Python are released.
I teach an introductory programming course myself, so I have an eye for concepts that can easily trip up new programmers. I think the greatest strength of this text is the simple, readable prose and the logical manner in which the material is presented. In courses such as math, chemistry, and physics, students are trained to learn a new concept and then apply that concept to example problems and homework exercises by following the pattern in the examples. While this is still true to a certain degree in programming courses, programming is more open-ended and there is often a large number of ways one can use the syntax and structure of the language to accomplish a given task. This open-ended nature can be a major stumbling block for some new programmers, who feel more secure with a "cook book" approach to problem solving. As the title of the book indicates, the text is written in a way that teaching the students to think algorithmically, thus empowering them to harness the creative aspect of programming.
The text maintains a consistent tone throughout. The terminology is consistent and new terms and concepts are introduced in a logical manner.
The text is divided into 20 chapters, each of which covers a specific topic. However, one has to be careful when not reading the text sequentially. For example, functions are introduced in chapter 3, but it is not a complete coverage. Functions are further explained in the following two chapters: 4 and 5. It seems the authors have organized the book in this fashion in order to keep each chapter short and focused, which is a worthy goal. But an instructor would need to be careful about assigning portions of the book to cover specific topics.
Excellent organization. Simple foundational topics are covered first and the chapters progress to more advanced topics at the end.
The PDF version is nicely formatted. The HTML version is simple and easy to navigate.
The book provides a good overview of Python syntax and basic functions, while also examining more complicated and potentially confusing concepts read more
The book provides a good overview of Python syntax and basic functions, while also examining more complicated and potentially confusing concepts (e.g., abstract data types). Python-specific glossaries are provided at the end of each chapter, and the ideas build from simple to complex. The book is good for both beginner and intermediate developers.
I worked through about a third of the code, and found no errors. I focused primarily on the concepts and less on the computation, and was pleased to see that - although the book can be useful as a tutorial - it also stands alone as a conceptual problem solving book, which reaffirms the title phrase, “how to think like a computer scientist.”
The emphasis on general programming concepts, and the exploration of computer science as a means of designing methods, functions, and algorithms to solve linear or iterative/recursive problems makes the utility of the book long lasting. Additionally, the focus on simple and fundamental core concepts (such as syntax and format), increases the usefulness of the book for beginner and intermediate level programmers.
Generally speaking, the authors carefully and deliberately explain the use of Python for solving specific computational problems. The later chapters become a bit abstract, but this is probably the nature of the concepts, and not so much a shortcoming of the explanations. Iterative readings, as well as continued programmatic familiarity, will help the reader understand more clearly. From a formatting perspective (i.e., bold, italics), the book does a good job of communicating types of Python language. At the end of each chapter, the glossary of newly introduced concepts helps cement the ideas further.
The themes and structure of the book are consistent from chapter to chapter, and relatively easy to follow. The concepts build consistently upon each other, from very simple to complex and abstract. Most importantly, the example problems are topically consistent, and are touched upon in multiple chapters (i.e., programming a card game).
The structure of the book lends itself to modular development, and even repeatedly reminds the reader to break processes down into smaller, more manageable chunks. The book also repeatedly suggests the benefit of generalizing snippets of code into tools that can be recycled into multiple workflows.
The flow of the book is good, incrementally proceeding from very basic examples of statements and functions to more complicated examples of classes and objects. The typological formatting of the book is explicitly designed to communicate an at-times non-intuitive Python vocabulary. The structure of the chapters becomes suitably familiar, and often iterates through multiple examples of achieving similar or identical results with varied syntax and structure.
The book is not designed to be a step-by-step tutorial, but instead balances applicable code examples with a narrative about the advantages and simplicity of programming in Python. In between sections, the reader is invited (in italics) to be creative and fix or enhance code without explicit or obvious guidance. The book will reward the casual reader and dedicated coder alike.
No grammatical errors of note.
The primary cultural relevance of this book is to make computer science more user-friendly, familiar, and attainable by providing tangible examples of programming as, essentially, stepwise problem solving. Additionally, coding is not portrayed as being particularly easy or difficult; good code is attainable, but it takes thought (to plan ahead of time) and patience (to fix afterwards).
I really enjoyed the combination of a broad overview and detailed examples of “how to think like a computer scientist,” and I look forward to reading again and recommending to my students as a good intro to programming generally and Python specifically.
The book covers the basics of programming in the Python language in a very readable fashion. The materials are organized reasonably well. The new read more
The book covers the basics of programming in the Python language in a very readable fashion. The materials are organized reasonably well. The new concepts are always introduced to have a direct comparison to previous Chapters. The new terminology is revisited in the end of each Chapter. The PDF file lacks links, which makes the reading slightly inconvenient. Each Chapter includes one or two questions for the students to think and code. More examples and Problems are definitely very welcome and helpful. I understand that this is a short book, but some important concepts, such as List Comprehensions, are not discussed. Overall, the book serves very well as introductory materials for the students to grab fundamental programming concepts using Python, and does this job very effectively.
I only spotted one minor error throughout the whole book. On pg 48, the “type string” should be “type str”.
The book's topics are very basic and so always relevant for Python Programming. Many people are concerned about the transition to Python 3 that has significant difference to Python 2 in terms of data types and many other aspects. That should be a completely new book to cover Python 3. I think the current book did an excellent job for introducing those basic Python concepts and styles that will definitely last in future versions.
The explanations and examples are extremely clear. For example, whenever a new type or new concept is introduced, it is directly compared or differentiated from previous chapters. Furthermore, the technical terminology is clearly defined throughout the text and in the end of each chapter.
The overall style of chapters is very consistent.
The text is divided up into 20 chapters and three appendices. All of them are relatively short with ~10 page each. The overall grouping of materials is excellent. Chapters are generally built upon previous chapters and it is better to read through in sequence.
The content is well structured. All the Chapters are very short and concise for specific data types or concepts, such as String, List, Tuples, Dictionary, Function, and Class. The flow is very well from simple to more complex, and new terminology are introduced in the beginning and revisited in the end in such a way that reader can also grab the difference to relevant ones in previous Chapters and that follows.
The main critic of this book is lack of links, which makes the navigation a little inconvenient. That would be helpful if the PDF can be made crossed-linked. Also, organizing the code in blocks instead of spreading out all over the place would make people test the code easier.
I was not aware of any grammatical errors in the book. Apparently, the book has been proof read by many authors and probably many readers as well.
For this matter, I did not find anything worthy of mentioning. No material presented in this book is cultural sensitive or offensive to any group of people.
I was very motivated to review this book upon request because my research group uses Python quite extensively as an interface language to electronic structure modeling. The book serves very well as introductory materials to students who do not have much programming background. Some of my students and myself did not have strong interests to understand or apply some of the concepts covered in the book (e.g., Queues, Tree). But overall I found it to be very readable, and I plan to use it as the required reading material for new group members and for a modeling course I am developing.
Table of Contents
- Chapter 1: The way of the program
- Chapter 2: Variables, expressions and statements
- Chapter 3: Functions
- Chapter 4: Conditionals and recursion
- Chapter 5: Fruitful functions
- Chapter 6: Iteration
- Chapter 7: Strings
- Chapter 8: Lists
- Chapter 9: Tuples
- Chapter 10: Dictionaries
- Chapter 11: Files and exceptions
- Chapter 12: Classes and objects
- Chapter 13: Classes and functions
- Chapter 14: Classes and methods
- Chapter 15: Sets of objects
- Chapter 16: Inheritance
- Chapter 17: Linked lists
- Chapter 18: Stacks
- Chapter 19: Queues
- Chapter 20: Trees
- Appendix A: Debugging
- Appendix B: Creating a new data type
- Appendix D: Recommendations for further reading Index
About the Book
How to Think Like a Computer Scientist: Learning with Python is an introduction to programming using Python.
About the Contributors
Allen Downey is an American computer scientist, Professor of Computer Science at the Franklin W. Olin College of Engineering and writer of free textbooks. Downey received in 1989 his BS and in 1990 his MA, both in Civil Engineering from the Massachusetts Institute of Technology, and his PhD in Computer Science from the University of California at Berkeley in 1997. He started his career as Research Fellow in the San Diego Supercomputer Center in 1995. In 1997 he became Assistant Professor of Computer Science at Colby College, and in 2000 at Wellesley College. He was Research Fellow at Boston University in 2002 and Professor of Computer Science at the Franklin W. Olin College of Engineering since 2003. In 2009-2010 he was also Visiting Scientist at Google Inc.
Jeffrey Elkner is a high school math and computer science teacher at Yorktown High School in Arlington, Virginia.
Chris Meyers is a professional programmer who teaches a beginning Python class at Lane Community College in Eugene, Oregon.