It's probably a bad idea to blog the week of Thanksgiving and I truly hope my readers (well, my American ones) are spending (healthy) time with family. That being said, holidays tend to be a great time for me to pick up new programming languages and tools. It's amazing how nice it is to learn something when I'm doing it just for fun. I've been learning, off and on, Python now for over a year. I still don't use it a lot, but the more I do, the more I appreciate it. I've come to realize that I think Python would be an amazing language for new developers. It's simple - doesn't require a compilation step - and lets you gradually expand your skillset as your needs and experience grow.
Speaking of new developers, this is where the book I'm reviewing will really come in handy. "Captain Code: Unleash Your Coding Superpower with Python", written by Ben and Shmuel Forta, targets people who have never written a line of code before and gently walks them through the process of becoming a code. It's light hearted, and uses games for many of it's examples, but I'm not sure I'd say it's a kids book. I'd say anyone who wants to give coding a try would be a perfect fit for this book.
While going through the text (disclaimer - at this point I'm approaching halfway done) I was honestly shocked by how many things the authors took time to explain that would have absolutely been a problem for non-traditional developers. As an example, very early on in the text they explain how you have to create a folder for your scripts. They explain getting an editor, saving and naming your files. This is something I figured out a very, very long time ago, but the more I think about it, the more I realize how non-obvious this would be. Think about how most mobile and tablet devices hide away the idea of a file system. While you may have a "Files" app on your device, just the initial "where do I start writing" idea is going to be something a reader has to learn once.
This continues throughout the text. Time and time again the authors explain concepts that folks coming from other languages wouldn't necessarily need, but first time coders would. For example, using variables in your programs so you don't have things hard coded in logic. The first time you write a program with hard coded values and realize how hard it can be to update, you figure this out. I love that the book calls this out. As I said, I really feel like Python makes a great first language, and this book makes a great introduction to first time coders.
I also appreciate how the reader is never talked down to. Like I said, it does look like a book aimed towards kids (although, um, I'm kinda into superheroes too ;) but it's one that never treats their readers as children.
Another thing I appreciated were times when the book pointed out concepts in such a way that the "academic" aspect of something could be contrasted with the "practical" nature of something. This is useful for times when we may say, "the precise definition of something is so" but "we almost always just do so and so in real life".
All in all, this feels like the work of people who've done real teaching, and quite a bit of it, and have crystalized it into a book that's easy to understand and quick to pick up.
The book is split into three sections. The first section really does a great job of covering the basics - essentially everything you need until you realize you need to start building re-usable blocks of code. By the end you've built a real game and have been given quite a few challenges and ideas for more things to build.
The second section really digs deep into packaging up your code, covering functions, and classes and additional libraries.
The third section introduces graphics and Pygame. I've only recently discovered it (in the other Python book I'm reading) and it's an incredibly cool games framework.
At 400 pages, quite a lot is covered, but there's two things missing I'd like to see added in either a new edition or a follow up book. First, there's no use of HTTP. With so much of a developer's work being API driven, I'd like to see at least a short section on this topic. Heck, using the Random Dad Joke API would be a perfect fit for this book. The second topic not covered is unit testing. Now... I'm not necessarily religious about unit testing. Obviously I believe in it! When learning a new language, I'm not sure I'd teach it in the first book, or first semester, etc. That being said, I remember being really surprised that Python had unit testing built in, and I can't help but think it should be highlighted. The book absolutely talks about testing your code. It does a great job in demonstrating real techniques that will be useful in that regards. But I'd still like to see maybe an appendix on unit testing.
Do I recommend this book? Absolutely. That being said, if you are an experienced developer learning to pick up Python, keep in mind this book will cover concepts you already know. If you would rather not pick up the book for that reason, I'd suggest the "Python Crash Course" book by Eric Matthes.