Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!

Allen Downey

Author
Greenhorn
+ Follow
since Sep 07, 2012
Allen likes ...
Java Python Ubuntu
Allen Downey is a Professor of Computer Science at Olin College and a former Visiting Scientist at Google, Inc.

He is the author of Think Stats, Think Python, the How to Think Like a Computer Scientist series (in Java, C++, OCaml, and more), The Little Book of Semaphores, and other computer science books, all available free at greenteapress.com.

Allen is an avid runner, gardener and cook. He ran the Boston Marathon for the first time in 2011, finishing in 3:45.

Allen lives in Needham, MA with his wife, two daughters, and two cats.
Boston MA USA
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
15
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Allen Downey

Hi All. Thank you -- it's a pleasure to be back. I'll be checking in this week to see your comments and answer questions. Looking forward to it!
1 year ago
Yes, every chapter includes code examples that are also available in executable form in the accompanying GitHub repository. And there are exercises at the end of every chapter, with solutions online.
1 year ago
Hi Joel, and thanks for this question. In my opinion, the traditional CS curriculum allocated too much time to the more theoretical parts of the field, and not enough to the more practical parts. If you are right, and there is a trend toward adjusting the balance, I think that's a good thing.

However, that is not to say that the theory and math are not important and useful! There is a big difference between saying "the CS curriculum should do a better job preparing students for work as software developers, and one way to do that is to reallocate some time from theory to practice" and "professional developers don't need math".

If you want to persuade you colleagues of the importance of algorithms, you might start an algorithm-of-the-month club, starting with the SIAM top 10 list

Several of the algorithms on the list come with a compelling story of how a smart algorithm transformed an intractable problem into a killer app.

Regards,
Allen
1 year ago
Congrats to all the winners! I hope you enjoy the book!

Allen
5 years ago
Hi All,

Thanks very much for inviting me to spend the week on the ranch. Thanks for the great questions and conversation (some of it pretty lively

As my sig says, you can check out any of my books at greenteapress.com. All are available in free electronic forms under a Creative Commons license.

Have a good weekend!

Allen
5 years ago
Teaching data structures and algorithms in Python is funny, because most standard data structures are either built into the language or available in libraries. So it's hard to motivate students to reimplement them.

On the other hand, Python is an excellent language for implementing algorithms: if you take the pseudocode from a book like Cormen, Leiserson and Rivest, you can usually translate it into Python with very little effort.

In Think Python Appendix B I cover basic analysis of algorithms, and as an example, I write an implementation of a hash table in Python. On one hand, that's a silly thing to do, because Python dictionaries are hashtables. On the other hand, the code is short and readable and (I think) makes it easy to understand how/why hashtables work.

Allen
5 years ago
The main thread through Think Python is from procedural programming to object-oriented programming, so I don't do a lot of functional programming.

I cover a few topics that fall under the general heading of functional programming: there are some examples that pass functions in as parameters, and lots of recursion. I present map, filter and reduce patterns, but we do it using for loops (for good reason, I think, but the style is not as functional as it could be).

Beginners often struggle with recursion, so I present it early (before iteration!) and often.

But I don't present recursive data structures in this book, and I don't think I use lambda to create anonymous functions.

So, no, functional programming is not a focus.

Allen

5 years ago
There are several GUI libraries for Python. I primarily use tkinter, but wxPython is big, too. With Jython you can use all the Java GUI libraries, too.

As Pedro said, Python compiles into bytecode which runs on an interpreter, and the interpreter runs pretty much everywhere. So, portability++

Allen
5 years ago
Hi, and thanks for the question.

In general, books that are best for learning might not be best for reference.

I tried to make Think Python work reasonably well as a reference; for example, I spent a lot of time on the index, so if you vaguely remember an example that you want to copy and modify, you should be able to find it quickly.

But the book really focuses on the most commonly-used subset of the language; it is deliberately NOT comprehensive.

So once you are comfortable with the basics, you will probably want a different book for reference or, more likely, web resources.

Allen
5 years ago
I have not used Jython, so others might have more to say, but the primary reason to use Jython is to use the Java libraries, especially the window toolkits.
5 years ago
Hi Pavan,

I think there a few things that distinguish Think Python from other Python books:

1) It is aimed at people with no programming experience, so I am careful to explain every concept we use (and avoid introducing concepts we don't need).

2) It is short. By staying focused, and constantly cutting what is not needed, I kept the book at a size my students can read in one semester.

3) From decades of teaching, I know which concepts are likely to trip people up. I have taken the most challenging ideas and split them into a series of manageable steps. Two examples: we start with functions that have no return value before moving on to "fruitful" functions. And I introduce object-oriented programming gradually, starting with functions and transitioning to methods.

I hear from a lot of readers who say they have tried and failed with other books, and then succeeded with mine. I think that is partly because I get so much feedback from my students and from readers.

(Now, in honesty, there is no book that is right for everyone, so it is possible that I am not hearing from the people who failed with my book and then succeeded with another.)

Thanks for the question!
Allen
5 years ago
Hi Jeanne,

"State diagram" has several meanings in different contexts. The diagram you showed is a finite state machine. In UML, a state diagram usually shows the states of an interactive system and the events that cause transitions between states.

In Think Python I use the term in a slightly non-standard way, to refer to a diagram that shows the state of a running program. In UML it would be called an object diagram, but at the point in the book where I introduce state diagrams, we don't know about objects yet.

Allen
5 years ago
I think Palak summed it up pretty well. The transition from Python 2.x to 3 has been going on for a while, and no end in sight.

One consolation is that most of the changes are small, so while you are learning Python, it doesn't matter which one you learn. Except for the print statement/function. That's by far the most visible change.

Programs like 2to3 can convert many Python programs from 2.x to 3 automatically. There are limitations, but for the programs I have converted, everything worked out of the box.

Still, I think Python 2.x will be with us for a long time.

Allen
5 years ago
Hi Dan,

Python is about as portable as Java. The interpreter runs in pretty much any environment with enough memory. And Jython can run anywhere there's a JVM.

I have not developed mobile apps in Python, so I don't know what the development kits are like. Anyone?

Allen
5 years ago
Yes, I think this is changing. The number of colleges using Python in their intro sequence is growing fast. But I don't have good current numbers. Does anyone have a source?

Allen
5 years ago