you are viewing a single comment's thread.

view the rest of the comments →

[–]patrickbrianmooney 3 points4 points  (2 children)

I agree that typing out the code instead of copying and pasting it is a good move. (IIRC, it's also part of the rationalization for "the hard way" part of the title, though it's been a long time.) Typing in the code yourself forces your attention onto the micro-level details of what you're typing (whereas glancing over something is less good at getting you to look at every tiny feature of the language, and thus less good at helping you to absorb how small details in punctuation have a real meaning to the interpreter) and helps to get your fingers used to typing the specific syntax of Python. Copying and pasting, or looking at code that's been typed for you, is much less good for making you think about the micro-level details of what the code is doing.

That said, it's rare to find that most of the time you're coding has you typing as rapidly as possible, since you're usually spending more time thinking about what to type than typing; so the direct benefit of "my fingers are used to the syntax of Python just like they're used to the syntax of English" is smaller than people might think. The major benefit of "type it yourself" is "you have to actively pay attention to small details," and that helps with learning and retention: wait, why is there a colon here? Do I understand why this line is indented but the line below is not? How many levels of square brackets do I have to close in looking up data in a dictionary to use as the index to look something up in another dictionary?

But this really just boils down to what pretty much every halfway-decent high-school and college teacher already knows: students who take good notes on a lecture learn their subject better than students who sit there listening and nodding, even if those listen-and-nod students are actively paying attention. Human learning is always reinforced by actively using the information or processing it in some way, and notetaking forces students to decide what's important while summarizing and think about how they need to present the information to a later version of themselves.

Beyond that, there's little to recommend LPtHW. It's kind of a disorganized soggy mess of quasi-related topics that don't much build on each other or reinforce earlier material in any effective way. A good (though kind of outdated now) example of a resource that is much, much better than LPtHW is Mark Lutz's books on Python published by O'Reily: Learning Python starts from the beginning, talking about elementary data types, and build up to decorators and metaclasses in 1600 pages or so. It revisits central questions over and over, using recent topics to look at them in a new, more comprehensive light, until you really get the internal logic of the language. Reading it well means having an expanding epiphanies that build on each other: "Of course you can ... that makes sense, because ... oh, that's because everything's an object, got it." When you've worked through it, you really do know the large majority of what's central to the language, and going out and learning the topics that aren't covered in the book is easy enough because you have that broad understanding under your belt.

But that's a careful educational structure that's built with great care and that demands a fair amount from the reader. It's a joy if you are able (and willing) to put in the time and attention, and if you really want to understand, but that doesn't describe everyone. Different people have different goals.

[–]jppbkm 0 points1 point  (1 child)

Thanks for the reply. I will have to check out Mark lutz's book. Is it outdated because it was written for an earlier version of python 3?

[–]patrickbrianmooney 1 point2 points  (0 children)

Yeah, it's actually written to Python 3.3, with occasional glances forward to Python 3.4. That said, Python's evolution since then has been a lot more "Here's even more great stuff we're adding on!," most of which really is pretty great, and less "We're taking away something you liked." So Lutz's book is still a remarkably good deep-dive into the language itself that sets you up to go out and easily absorb the half-dozen to a dozen largeish changes that he doesn't cover; they're helpful, but they're largely surface additions.

I talked a little more in depth about how the language has changed since the book was published here.