A few years ago, a fellow named Zed Shaw created a website called Learn Python the Hard Way that a lot of people praised. The website is made up of lots of short exercises that help beginner programmers learn the various nuances of Python but in bit-sized chunks. He kept updating it from time to time and eventually Addison-Wesley turned it into a book by the same name. I was recently given a copy of the PDF version of the book to review. Here’s the quick version:
- Why I picked it up: I received this book specifically to review it, although I was interested in reading it anyway just from what I’d heard about the site
- Why I finished it: The book’s chapters are short…and technically, I skimmed a lot of it
- I’d give it to: Someone who wants to learn Python and who has no previous experience with any other language
Paperback, EPUB, MOBI, and PDF
The book is split into 52 exercises or chapters, if you will. Most of the chapters are under four pages in length. In fact, there are a lot of chapters that have a blank page between it and the next chapter, so there is some filler going on here. Each chapter also has some drills and some common student questions in them. As expected in an introductory text, you will learn about all the data structures that you’ll need as a Python programmer. From simple things like strings, dictionaries and lists, to conditionals, loops, functions and classes. They are all covered here. The book also goes over Booleans, Is-a / has-a, inheritance, composition, testing and the lpthw.web framework.
In the introduction, Mr. Shaw makes a big deal about how if you, the reader, feel like he is insulting your intelligence, then you are not in the intended audience for this book. That section alone is rather insulting whether you’re a beginner or not. I didn’t really appreciate it when he stated that “programmers lie frequently about being math geniuses when they really aren’t”. I assume he is attempting to be funny, but he comes across as snarky, at best.
The book does a good job of covering the fundamentals of Python. There are usually several exercises for each new topic. For example, learning to print to stdout is covered in 3 exercises as is File I/O. I thought it was definitely a good idea to include the study drills and the Q/A sections as they enhance the material covered in each chapter. I do think the last few exercises don’t fit as well. They don’t fit together with each other and seem to be kind of standalone topics (game, skeleton, testing, website, etc). On the other hand, these last few exercises are also much longer than the previous ones, so maybe that’s okay.
Regardless of whether you enjoy the snarky / patronizing bits, the core content is pretty good. I like how each piece is put together and how the chapters build on each other, increasing the reader’s abilities one step at a time. I think beginners will benefit from the book, but I would recommend checking the website out before you purchase the book.
Learn Python the Hard Way
by Zed Shaw