Learn Enough Python to Be Dangerous (Pearson) |
Author: Michael Hartl I am not happy about the aspirations that the title professes. Are we really content to learn just enough to be dangerous. The author claims that the intent is humorous and "dangerous" is meant in a good way. Ok, it's just marketing, I know, but it would ring true if the book was focused on "enough" rather then nearly everything. It is, after all over 400 pages long so you aren't going to get a short introduction to Python. Part of the reason is not just that Python is a big language, it is, but the book covers Flask for web apps and other libraries for data science. It also has lots of images that are intended to enliven the presentation, but for me don't help much. Chapter 1 is just about getting started, but, even though it quotes the zen of Python in its entirety and other Pythonesque ideas it really doesn't seem to be in touch with the language. My faith in the book took a slight knock when I read the list of things that are supposed to be different about Python. The first item is "Use print for printing". Now to me this isn't really something that I would put first on the list - I'm not even sure its particularly true as print is used in Basic, Kotlin, Java, Go, Ruby and so on... The other differences are similarly very odd and really miss the point. For example, the sixth difference is "Python doesn't have an obj.length attribute or an obj.length method: instead use len(obj) to calculate object lengths." Well, yes, this is true, but it misses the fact that Python has a lot of functions that work in this way and it isn't one-off idiosyncrasy but the implementation of a principle that methods that don't depend on the object shouldn't be part of the object. The list also misses the things that do make Python different - everything is an object including classes, it implements multiple inheritance, it has first class functions and so on... Chapter 2 is all about strings, but it also intrduces flow of control which doesn't really seem like a good mix. Chapter 3 is also about data, this time lists, but little is made of the similarity between Lists and Strings. Chapter 4 adds more built-in objects to the mix - math, timers and regular expressions. Here we also meet the Dictionary which is one of Python's really distinctive features. Chapter 5 moves on to functions and does indicate that they are first class but doesn't really make it clear that they are also objects. Chapter 6 is titled "Functional Programming" but it is really all about comprehensions - and functional programming is so much more than this. Decorators aren't mentioned at all. Chapter 7 finally gets onto objects and classes but just the very basics - nothing about multiple inheritance and nothing much about the unique way that Python implements all of this nor how you should best use it. After Chapter 7 the book really isn't about teaching you Python the language, it's about using Python. Chapter 8 is about test driven development. Then we have a chapter on writing shell scripts, a web application using Flask and a chapter on using Mathplot , Pandas and scikit-learn. All possibly interesting but it would have been more on topic to spend more space on Python the language. Verdict If you want a book with a lot of Python examples and not much explanation of what makes Python special then you might get something from this book. Will it make you dangerous - possibly but not in a good way. To keep up with our coverage of books for programmers, follow @bookwatchiprog on Twitter or subscribe to I Programmer's Books RSS feed for each day's new addition to Book Watch and for new reviews.
<ASIN:1871962587>
|
|||
Last Updated ( Saturday, 15 June 2024 ) |