getify / You-Dont-Know-JS

A book series on JavaScript. @YDKJS on twitter.
Other
179.37k stars 33.48k forks source link

Emphasizing the importance of running the code #297

Closed albacoretuna closed 9 years ago

albacoretuna commented 9 years ago

Thanks for the great book series. I really like these books. I have something small to share with you. IMHO the importance of actually typing down and running the sample codes is not emphasized well enough. And because the text is very well written and fluent, specially beginners might just read the whole books without running a sample code critically.

getify commented 9 years ago

Are you referring to any specific book, or just all of them?

albacoretuna commented 9 years ago

All of them.

getify commented 9 years ago

I addressed this topic in the "first" book of the series, "Up & Going", here, as well as other places. But I didn't specifically call it out in each other title because the assumption is that the code is provided so you can learn from it and try it out.

albacoretuna commented 9 years ago

Yes I see. But I think it still deserves more attention, at least at the beginning of each title. Reading programming books like fiction and then complaining about how hard it is to grasp the concepts is a common problem specially among beginners.

mallowigi commented 9 years ago

I don't really agree. Besides, I think the examples are too abstract to be fully understood anyway, a newbie in Javascript would not understand, and a veteran would surely miss the point. It's not by reading, or worse, by copypasting the code, that we can understand how it works behind the curtains.

This is what I really loved in these books, that it doesn't put the emphasis on the code examples and formal boring definitions, but instead, that it is explaining obscure contexts (such as promises and closures) easy to grasp for any kind of programmer!

getify commented 9 years ago

My personal take is that some people learn better by reading prose, others by seeing code examples, others by typing and running it themselves, and still others by some mixture of the three. The book should provide enough of the raw info in its various forms that most readers can connect what they need to learn.

But certainly, it should be understood that you get out what you put in, as a quick glancing skim over such dense material will not give you much more than a surface understanding at best, while carefully pouring over each sentence and code snippet and typing and running them will dig much, much deeper.

In fact, ironically, that's kind of a metaphor for the whole series, and its commentary on the state of learning and understanding in JS these days. The problem I'm trying to tackle with YDKJS is that we're so typically "surface learners" where breadth is rewarded over depth. These books stand as a challenge for the opposite.

getify commented 9 years ago

@bmacdonald-oreilly do you have any thoughts on this, broadly across the series?

bmacdonald-editor commented 9 years ago

I think it's implicit in all technical books that you should try out the code for yourself, or else why would we put it there, as well as providing the code separately for download? I don't think this needs to be emphasized.

For what it's worth, in my personal learning style, I like to read the code on the page carefully and understand what it's doing, before I try to run it. That's what I've been doing throughout this series, and it's working for me, with one or two exceptions.

getify commented 9 years ago

The "ES6 & Beyond" title has yet to be written, so I'll try to keep this in mind while writing it, and try to emphasize implicitly the idea that trying the code is useful. :)