Bests & Worsts Reviews from Amazon

according to people

132
people found this helpful, as of 2023
ranked #221,739 most helpful out of 571,544,897 reviews
★☆☆☆☆
A Recipe for Disaster
Previously, I reviewed the "Java How to Program" book and found it to be a terrible waste, sure to take all the fun and creativity out of programming. So when I saw this book on the shelf, I flipped through it, hoping that the free-wheeling nature of Python might have lead the Deitels towards a more enlightened approach to instruction. I quickly found that this book has many lessons to teach (although few that I would agree with). For example: * Python programmers are NOT having more fun than Java (or other) programmers; all languages are equally stultifying. * Learning a language is a tedious task, centered around learning features of the syntax in a prescribed order. (This is like learning to cook by trying ingredients one at a time in alphabetical order, without ever trying to put together something tasty.) * The practice of programming has no underlying principles, only an endless series of tips presented in overly-garish multicolor pages. (You'd be better off with a single chapter of "Structure and Interpretation of Computer Programs" than with anything in this book.) * Programming is inherently boring, involving endless repetitive typing; it is better for the programmer to do a lot of work than to expect the computer to. For example, consider this example from chapter 4 (Fig 4.7): =================================== import random frequency1 = 0 frequency2 = 0 frequency3 = 0 frequency4 = 0 frequency5 = 0 frequency6 = 0 for roll in range( 1, 6001 ): # 6000 die rolls ___face = random.randrange( 1, 7 ) ___if face == 1: # frequency counted ______frequency1 += 1 ___elif face == 2: ______frequency2 += 1 ___elif face == 3: ______frequency3 += 1 ___elif face == 4: ______frequency4 += 1 ___elif face == 5: ______frequency5 += 1 ___elif face == 6: ______frequency6 += 1 ___else: # simple error handling ______print "should never get here!" print "Face %13s" % "Frequency" print " 1 %13d" % frequency1 print " 2 %13d" % frequency2 print " 3 %13d" % frequency3 print " 4 %13d" % frequency4 print " 5 %13d" % frequency5 print " 6 %13d" % frequency6 =================================== (Note I use "_" for blank because Amazon won't indent code properly.) This is 30 lines (42 if you count the copyright notice) for something that a grade-schooler could tell you (I know -- I asked one) is better done with 7 lines: import random def roll(n, sides=6): ____freq = [0] * sides ____for roll in range(n): ________freq[random.randrange(sides)] += 1 ____return freq print roll(6000) Or, using a built-in class, with one line: print(Counter(random.randrange( 1, 7 ) for _ in range(6000))) I find it a case of student-abuse to present examples like this, but I suppose the Deitels had their reasons: perhaps they hadn't introduced lists (or functions) yet. Perhaps lists (or functions) didn't fit readily into their idea of the right order to learn concepts in BASIC (which must therefore be the best order to learn concepts in every other language). It would be ok to present this program first, but then it should be followed by a more concise version. If you want to learn Python, or learn to Program with Python as your first language, try another book such as "Learning Python" or "Programming Python". If you want to ensure that you won't appreciate why Python is the way it is and why it is interesting; if you want to be bored and avoid learning how to do something creative, by all means stick to this book.
September 2003 · Books
the product in question
Python How to Program(Parts A & B)
3.6★ · 22 ratings, as of 2023
worser bester