Learn Python: Written from the Ground Up for Newbies and Old Programmers Alike
Want to Learn Python? Pick Up This Book!
This is where Mark Lutz and his infinitely successful Learning Python (also referred to as LP in this review) come into play. Mark has been writing books solely focused on Python for 12 years now, longer than any other author I've found aside from Guido von Rossum, the inventor of Python itself. Many of his books are considered to be the books to get if you wish to learn the language and learn it correctly. I've read a lot of programming books in my time as a programmer and frankly, most of them stink in terms of readability. I'm not talking about the fact that they're easy to read or get the information across but they're downright ghastly in terms of enjoying reading the darned things. Programmers program and occasionally write technical documentation but word smiths and scribes they are not. Years ago I stopped reading programming books because I found they'd make better paperweights and book shelf adornments than reading material. Mark succeeds very easily in engaging the reader to actually read the book and understand the material at hand. I've managed to read at least 20 or 30 pages a day since I got this book and I haven't tired of it yet.
But how did I come across this fine book and Python itself? Well, I've dabbled in horribly written Python scripts for a few years now and if I ever needed to do something substantial, I used PHP. One day, without any reason, I decided that I was going to learn Python for fun, something I haven't done in years, literally. I headed to Amazon and began reading reviews on various books including the paper copy of Dive Into Python which is freely available on the web. Reviews were all over the place, from praising an author -- instead of his book -- for his previous efforts in writing to the general consensus that every book was "the" book to get. So I plunked down the money for O'Reilly's Learning Python and got it in two days thanks to Amazon Prime. I think the first day I got the book I read at least 60 pages, something of a feat for me since I'm a purposefully slow reader. I got the book on a Thursday and by the end of Sunday, I had plowed through at least 200 pages. Much of the early material was nothing new to me: arrays, hashes, loops, conditional testing, and so on. Being an intermediate programmer I was able to pick up on most concepts and Python's lexicon easily but Mark is able to explain constructs such as lists (arrays in other languages) without a problem and he'll make you understand why you need them. This is a constant thread throughout the book. Lutz provides real world examples alongside textbook examples to show you why something is important, these are typically given in "Why You Will Care" boxes after certain introductions of language constructs. These little info boxes do much to cement modules, libraries, and practices you'll continually use if you fall head over heels with Python.
By now, I should be getting into deeper details of the language and how Mark Lutz brings it across but I'm reviewing his book, not the language so I'll skip over all that and let you read the book itself. The first 300 pages are all a build up to what has become Python's core application: code reuse and Object Oriented Programming or OOP for short. Everything in Python is an object so this naturally lead to OOP becoming a leading trend of the larger scope of Python programming. Lutz does a good job of spending 300 pages telling you why you should write modular and reusable code and frankly, you should take his advice. Having reusable code means you can cut development processes down if you have a module, class, or function that is "drop in" ready or can be with slight code modifications. If you've done any programming past simple scripts, you can immediately understand the useful nature of this. At this point, Mark spends the rest of the book pounding OOP into your head and why it's good for you. This isn't always the case in other languages but works naturally in Python since everything is already an object. Most of the book is a high point in programming text but I really felt there were things that most of us programmers use everyday that were barely touched upon or not at all.
I think my biggest letdown in this book, and another of his, is the fact that Lutz apparently hates regular expressions or simply make almost no use of them at all in his work. Lutz writes a paltry two paragraphs about the regular expression engine in Python and if you're an old Perl, PHP, or Bash programmer, you've come to rely on this handy mechanism. Like I said, maybe he doesn't use them but I don't know anyone that has to do any type of text processing that doesn't use it. I even bought another book of his and was dismayed at the same dismissal of regular expressions, except in the other book I believe he wrote three paragraphs. It's not that regular expressions are complex to use in any language, it's that Python's module for it has a confusing syntax and one that changes based on whether it's called as a method or as the module itself. If you have a compiled regular expression and you call it as a method of another object, the syntax for it is just different enough to cause a code failure than if you call it as as object of the "re" module. It's an easy trip up for first time programmers and even guys like me who write regular expressions everyday, I just don't understand why this is not touched upon more in the book than it is.
An overall problem people have with how Mark has written the book is how he constantly compares it to the C and Java programming languages but I have no clue why this is a problem. The core interpreter of Python itself is written in C for computational speed and borrows much of its syntax from C so naturally, why not compare it? There are millions upon millions of C programmers out there and tying in Python's functions to C's makes transitional learning just that much easier. Why are other people up in arms about his comparisons to Java? Once again, I have no idea. There are language constructs borrowed from Java as well and there's a Java-based implementation called Jython so again, this comparison helps Java programmers leverage their knowledge into another language more easily.
I love Learning Python more than any other programming book I've ever read and I've got a bookcase full of them! Since Mark Lutz has 15 years worth of experience programming in Python, this comes through in his writing. I'm not sure if he has ever taken general writing classes but his writing style is cordial and draws the reader in from page one. With Lutz, it's not all about writing functions and getting programs written, it's about learning the language at your own pace and understanding the purpose behind it and its functions. I've already recommended this book to a number of my friends who are looking for a new language and I'll soon be digging into Mark's monstrous "bible" of Python, Programming Python, 3rd edition.
Published by James Westfall
I'm a systems administrator with a love of reading and knowledge. By day, I slay spam and woo end users but at night, I read and write, debating theology and reason. Music captives me yet leaves me wanting... View profile
- More Regular Expressions in Perl This is an eight part series. This last part gives you extra features in Perl Regular Expressions.
- Extra Features in PHP Regular Expressions This is an eight part series. This last part gives you extra features in PHP Regular Expressions.
- Using Regular Expressions in PHP This part of the series shows you how you can use PHP Regular Expressions.
- Building JavaScript String Regular Expressions If you have read the previous part of the series, that is good. It is now time to learn how to build or construct Regular Expressions with the JavaScript String Object.
- Introduction to JavaScript String Regular Expressions In this article I explain the meaning of Regular Expressions and I introduce you to the concept with the JavaScript String object. You start learning what is called Matching.
- An Integrated Approach to Language Learning
- Features of Object Oriented Programming
- An Introduction to Programming in Perl
- Using Regular Expressions in Perl
- Regular Expressions in Perl for the Novice
- Top Baby Names for Boys from 100 Years Ago Are Still Popular Today
- Flags in JavaScript String Regular Expressions
|
|