For most of my career, I’ve worked with Java or other JVM-based languages (i.e. Scala and Groovy). However, I recently accepted a job offer with a largely Python-based shop. It’s been maybe 10-15 years since I last dabbled with Python, even for a personal project. So ahead of this new start date, I wanted to quickly ramp up with the core language as best I could.
Two of the resources I’ve used are “Python Crash Course, 2nd Edition” by Eric Matthes, and “Python Basics: A Practical Introduction to Python 3” by a team of authors from the realpython.com site. Since the books are so similar, I thought I would consolidate both into a single review for comparison.
Each of these books are divided into two main parts. The first, covering basic information about the core language, and a second part that presents examples of practical application.
In both cases, the core language overview is presented with a breezy style, that is primarily aimed at complete newcomers to programming. Broadly speaking, pretty much everything about “Python Basics” is 2x that for “Python Crash Course”. The core language section is around 400 pages, compared to 200. There’s about twice as much depth and examples for each topic, as well as some topics that “Crash Course” doesn’t cover at all (e.g. modules and packages). On the other hand, of course, the cover price is roughly double too!
To be fair though, sometimes the gaps go in the opposite direction. “Crash Course” provides coverage of unit testing in its core language section, at least with the Python standard library’s
unittest module. This entire subject is a disappointing omission in “Python Basics”.
With BOTH of these books, I would be happy to jettison the “practical application” sections in favor of more depth in the “core language” sections. Neither of these books cover list comprehensions (or their
dict counterparts). Comprehensions have been part of Python since version 2.0, over twenty years ago. And based on what I’m seeing, working on practice exercises at Exercism.io and looking at community submissions there, you’ll have a hard time reading other people’s Python code in the twenty-first century without some familiarity.
Neither book’s core language overview covers decorators. Not even the most basic use of
@property for getters and setters. At least “Real Python” introduces
pip. But neither book’s core language section talks about virtual environments, and managing dependencies on a per-application basis. Lastly, neither book even mentions type hints, which have been a part of Python for nearly 7 years now. With me coming to Python from statically-typed languages, I certainly plan for them to be more prominent than that!
Maybe there’s only so much scope that you can (or should) cram into an entry-level beginner’s book. Even so, I think the “practical application” sections can be a bit wasteful. Of the two, “Crash Course” is the more focused and fun. It has you developing a simple video game with PyGame, learning about data visualization with Matplotlib, and building a web application with Django. This is a pretty decent cross-section of Python’s strongest use cases, and the material is well-written.
“Python Basics” is a bit more all over the place, with projects for modifying PDF files, and building desktop GUI applications with Tk. As a huge Tcl/Tk nerd back in the 1990’s, it pains me to say this… but dedicating 100 pages to Tk, in a Python book published in the year 2021, is a pretty weird call. I would love to see examples that are little more practical and “real” here. Drop the PDF and Tk stuff, and maybe introduce web API’s with Flask. Lose the chapter on working with raw SQLite, and provide some overview of SQLAlchemy instead. Despite being a much shorter book, “Crash Course” manages to cover these concepts effectively, using Django and its ORM.
Closing on a positive note, I really did enjoy reading the bulk of “Real Python”. It’s 400 pages of core language coverage gives it space to breathe, and covers a lot of nuance that’s omitted in “Crash Course” and the Python website’s free tutorial. Its coverage on string manipulation is the best that I’ve seen anywhere so far, and I’m grateful for them explaining some quirks in Python’s lexical scoping rules (spoiler – it’s just best to never shadow variable names in any programming language!).
Overall, “Python Crash Course” would be my recommendation for complete programming newbies, who just aren’t connecting with the free tutorial on the Python documentation site. For those people, the 600+ pages of “Python Basics” might be a bit intimidating. For developers already experienced with a different programming language, you’ll probably get more out of the free documentation than you will from “Crash Course”… but the sample projects section is still worth the (low) price of admission for this book. In my case, I already have a personal O’Reilly subscription and can therefore read the e-book “for free”, so it was a no-brainer worthwhile use of my time.
I would recommend “Python Basics” to developers with a bit more prior experience, or at least to any newbie willing to pay more money for more depth. Unfortunately, this book is nearly twice the cost of “Crash Course”, isn’t available on O’Reilly’s subscription service, and the e-book is far MORE expensive than its dead-tree version (which is absurd). However, I certainly don’t mind supporting the realpython.com team, because their website has been the most helpful resource I’ve found as I get my feet wet with Python. They’re usually the first link on the results page for any term I search, and almost always the best link. They also have a podcast that is the best of all the Python-related podcasts I have sampled so far.