Hacker News new | past | comments | ask | show | jobs | submit login
You Don't Know JavaScript Book Series (youdontknowjs.com)
226 points by colund on Feb 16, 2015 | hide | past | web | favorite | 80 comments

I posted this link after having read the author's comment to a one star review on Amazon:

"Kyle Simpson8 months ago Report Abuse I can assure you, my goal of splitting up the content into a book series had ZERO to do with making more money. It's actually quite the opposite. One of the things I hate the most about tech books is that I spend $35-50 on a big book of which there's only a few chapters I actually care about. I almost never read a whole book.

I decided when I wrote this content that I'd make each logical chunk of content available separately, which means that you can buy only the stuff that you actually care about. This COULD quite likely mean that I make a lot less money in the overall picture, because there will be plenty of people who don't buy all the books, or even not enough of them that would have generated the same income as a single book would have.

This places you, the reader, more in control, not only of what you buy and own, but more deeply of what you spend your money on compared to the content you get. Rather than being about me greedily making more money, it rather downgrades my ability to make bigger chunks of money per copy for the majority of people who (like me) only want/need part of the content.

With regards to this content being "pointless", that seems quite a spurious and unsubstantiated claim. Pointless to you? Perhaps. But I feel quite certain there's a lot of content in there (like block scoping, etc) that most developers (and perhaps even you) aren't fully aware of. If you're already a JS expert (even on all the new ES6 stuff coming), then you probably do know JS and I'm not sure why you bought the book.

The spirit of the whole series (given the title) is to get us all (myself included) to admit how we don't fully know JS and how we need to dig deeper than we have before. If that's lost on you, I'm sorry.

One last comment: these books are all available fully for free to read here: http://YouDontKnowJS.com In addition, Amazon's site makes preview snippets of the book available to read for free so you can get an idea of what you're buying. It's a shame you apparently didn't read the content/previews before buying, you could have saved your $5-7 (at least it wasn't $35-50)."

I'll be honest, I'm working through a React book right now, and there's so many additional subject chapters that, while useful, would be better off spun off into their own books. I found the first 2/3 of the book immensely useful, but now it feels like I'm slogging through to finish it (just for the sake of finishing it).

Maybe splitting things up into very self-contained contexts makes a lot more sense than writing another tome.

What is the book?

Will you release a version for those who want the whole compilation for a smaller price?

Valid points. Shouldn't have fed the guy but valid response none the less. 200 pages on a subject versus two or three 30 page chapters? Good call!

Small books would also make updates easier (if some APIs referenced in a book change, for example). Seems like a good way to go.

Here's the thing, I do know Javascript pretty well after reading Crockford [1], Braithwaite [2], and Javascript Garden [3]. Much of the behavior of the language is simply too subtle and failure-prone to bother with, especially when working on projects that aren't composed entirely of world-class JS devs (e.g. every project ever). In its full expressiveness, Javascript yields code that simply does not do what you think it does, unless you've memorized the 6 books of material documenting counterintuitive behavior.

I'm with the prevailing industry consensus, that Javascript has some brilliant parts to it, and when used judiciously, and with the right abstractions, it's not so bad. But some of the more subtle concepts in Javascript, logical consistency aside, simply don't make for great programming.

[1] http://javascript.crockford.com/

[2] http://leanpub.com/javascript-allonge

[3] https://bonsaiden.github.io/JavaScript-Garden/

JavaScript has changed a lot since. The way we do asynchronous computation (callbacks -> promises and coroutines), the idioms we like/hate, the runtime performance penalty of different styles.

It's true that crockford, javascript-allonge and JS Garden are all good resources but they are simply not as up to date as YDRNJS and they're not as covering.

This book doesn't cover 'with' in depth or anything like it. It explains idioms that have formed since "The Good Parts" came out - that was a long time ago and a lot happened since.

What subtle counterintuitive behavior are you talking about? The only things I can think of are == and if (0).

I don't get it either. The only one that got me was that you have to scale some decimal numbers to whole numbers to multiply them.

    0.1 * 0.2 //0.020000000000000004
But this has never caused issue for me except when tried to make a "prime number finder" when I first started using it.

If I was going to build some stat site with a whole bunch of scientific data, I'd probably break out the python. IMO JavaScript is just the best language to work with if you're coding web sites or web applications (and probably prototyping custom UIs for anything). Plus you can use multiple languages server side easily, so use the right tool for the right job.

If you try to combine object methods that use 'this' with functional programming-style code, you're in for a bad surprise

Yea, when people try to rebuild all the fanciful embellishments of classic OOP GUI programming in JS, they're going to have a hard time. Unfortunately I've had to maintain this kind of code in the past. Don't use 'this'. I'm afraid that the addition of the 'class' keyword in es6 will make this tendency worse in some programmers. Along with block scoping, it's a feature lobbied for by people who don't actually code much JS.

And that's JavaScript's fundamental problem: it's full of attractive nuisances that have the nasty property of silently doing the wrong thing. 'this', 0=='0'==false==[]!=[], global variables by default, objects that are almost-but-not-quite maps, for-in-oops-forgot-hasOwnProperty, etc, etc.

Wow, everyone here seems to be really put off by this title. I thought it was clever and funny. Title's are meant to grab attention and drive sales, and secondarily to also inform the potential reader of the topic.

This title caught my attention, so first purpose, check.

I think the book is positioned for beginner to mid-career engineers working with JavaScript that want to do a deeper dive and based on the title is presented in an irreverent and funny tone. If it is those things, it accomplishes #2.

Great title. I haven't read the book, so I don't have any opinion on it beyond that, but can we try and take things a -tad- less personally?

i'd be curious to hear others' opinions, but it seems to me JS isn't the sort of language that one wants to master in itself. it's very much a language defined by its use cases.

then again, i'm just trying to become an all-around better fullstack developer for my current employment situation - so i'm mostly using (and pull-requesting) frameworks rather than writing my own

given this perspective, i'm much more interested in the entire [and rapidly expanding] toolchain for modern js development - and learning the language's esoterica [and i am the sort of person who takes pleasure that stuff] as i become an all-around better js dev

Frameworks change very often in JS land. Understanding the fundamentals of a language very well will give you a great productivity boost even if you're writing Angular/Backbone/Knockout/Aurelia/React/Flux/JSMVC/whatever_framework code all day.

This book isn't about the edge cases of how `==` works or how `>` works when comparing objects of different types. It's about the fundamentals of the language and the idioms and how to write effective code using them.

If you already know JS very well you can skip it or skim it - but if you're a 'framework developer' as a reader I guarantee that it will be worth your time. If your JS is already very good - you might want to consider spending your time learning another language or technology rather than being "more great" at JS unless you want to get involved in the specification process.

> but it seems to me JS isn't the sort of language that one wants to master in itself

Well, depends how you define "master". To become a leading expert on it would mean taking time away from other skills, which probably wouldn't be wise. But if you're using JS quite a lot then learning it to an arbitrary level, let's say 80% of "master", well, that probably would be a good shout.

I suppose it depends on your skillset projection, do you see yourself spending a lot of the next five years with JS? If so, invest now in personal development. If not, maybe skim read it.

The proposition that I approach JS from, including my writing of these books, the JS workshops I teach, my OSS work, etc, is this:

If you're going to make JS your primary language that you write on a daily basis, doesn't it make sense to invest more time into learning it than just whatever you might accidentally pick up through trial-and-error?

Most developers in most other languages do tend to take formal learning of the language, to a deep extent often, a more serious task, but with JS it seems many developers just kinda get whatever they get along the way.

I have found that approach to be good at getting and keeping yourself employed, but bad at giving you any confidence that you actually know what's going on. If you aren't really sure exactly why your code works, my theory is that you'll never know exactly why your code doesn't work either.

I'm just trying to provide resources for developers who want to take learning JS seriously, and challenge "all" of us to ask, "just how much DO I know JS?" The rest is up to you. :)

Six books, each $20, none of them that big? That seems excessive to me.

Does it need to be spread so thinly?

> each $20

I'm trying to work with O'Reilly to bring down the prices on the books a little bit. I always wanted them to be priced so that price wasn't a barrier to entry. As you can imagine, there's lots of intricate details which restrict what I can do with pricing.

> none of them that big


Page counts on the titles (so far) are: 65, 98, 176, 189, 296. The last book isn't finished yet, but I'm projecting it to be somewhere around the 150-200 mark.

I can appreciate that $20 for a 100pg book may feel "excessive", but what about $26 for a 296 page book?

Moreover, I'm working (still) on getting O'Reilly to release a box set for a flat price that will be much more reasonable than buying each book individually, so that if you want the whole series you'll have an affordable option for that.

And you'll of course still have the option to buy just one or two of the books if that's your fancy.

Thank you for showing a commitment to getting useful knowledge published at reasonable prices. And of course, there isn't anything more reasonable than "free on github". I'm excited to pick through these books to become a stronger javascript programmer.

Aaah - sorry, I hadn't realised that some of the books were much larger than the first two I looked at. $20 for a 300-page book is very good value!

I just looked at a couple, and it seemed like it was being split into small chunks (60 pages, 100 pages) as a way of selling more of them. Clearly I should have researched further!

Read them for free online, and if you're a tactile person and enjoyed the books, buy them. Probably the best deal you're gonna get!

All of them are available online for free - as the other comment states: the logical division is so you don't have to buy books about things you don't care about. It's not about making more money.

> none of them that big

You sound like middle management weighing lines of code instead of quality of work.

I love reading Kyle's work and have had the privelige of seeing him speak a few times. He has an uncommon capacity to dig into the little, grouty nooks of JavaScript and uncover precious veins of knowledge. If there is anyone that I would trust to write a worthy series of technical books on JavaScript, it's him.

The content is interesting but I find them verbose, but I like when it is very terse.

I take the title to mean that someone has taken time to do some research and share it with me. reading the material will help me fill in some gaps and hopefully dispell or validate assumptions I never took the time to test.

That is exactly my intent. I certainly hope the books live up to that vision.

I think it could be great to give an order for reading the series for someone that's learning JavaScript. I often recommend this series but everyone asks me where should they start reading.

Great point! The order of titles listed here is the intended reading order:


Also, the "Up & Going" title, Chapter 3, has descriptions about the titles and the narrative/story arc being told across them, which helps understand the intended order as well:


I'm missing the title:

"Everything you always wanted to know about Javascript but were afraid to ask."

By Woody Anybody

For those interested, I recently found a tool that will convert Markdown files into an ebook. I used it for the Laravel docs, but you could use it for these books too. I'm sure there are other tools, but this was very simple to get going.


Also note that these books are available for purchase as actual official ebooks. If you read the content and find it helpful, I of course appreciate any purchases made. :)

Is there content in the book that isn't on Github?

The book series (6 of them) is drafted, and to some extent edited, on GitHub. What you see is what you get.

There are some edits and refinements that happen to the content during the publishing/production phase at O'Reilly that aren't necessarily appropriate to back-port to the repo. But I do try to get most of the main substance stuff sync'd.

The free GitHub repo versions of this content represents the drafts of the books in the mostly complete stage, whereas the published books (digital or print) are the final, final versions.

"You don't know x."

"10 things you didn't know about y."

"Everything you thought you knew about z is wrong."

Am I the only one that finds titles like this completely offputting? If you think you have insight that's useful to people, try not talking down to them. As it is, hell, I may not know Javascript, but I'm certainly not clicking through.

I explain the title, and the intended tone and purpose of the book series, in the preface. If you wouldn't mind taking the 3 minutes to read it, I'd be curious if it changes anything about your opinion of the title:


Nope, it still doesn't work for me, personally. I never played "You Don't Know Jack", and so I tend to interpret your title literally. And your title implies that no matter how much somebody knows about JavaScript, it's not enough.

Two decades ago, I was really into learning all the disgusting corners of badly-designed programming languages. I got really excited about C++ implicit conversions and clever template hacks. But that always proved to be a mistake, because nobody wants to read or maintain any of that crap.

These days, I try to focus on the essentials of a language: What works well and portably? What offers unique expressive capabilities that I haven't seen before? What's idiomatic? If I learn any nasty corner-cases, I only do it solve a specific problem, or to avoid pitfalls.

I really can't get excited about the implicit conversion semantics of JavaScript's "==" operator or the weirder points of how "this" get bound in callbacks. It's all just pointless technical arcana. If something neither expands my brain nor solves an immediate commercial problem, I'm happy ignoring it until it becomes obsolete. And my clients are usually a lot happier, too.

(That said, the actual books are nicely written. But you asked about the titles.)

This. "Technical arcana" is exactly right.

Your code should rarely be clever or rely on the the weird dark corner-case cruft of a language. Too often I see JS code written like an entry in the Obfuscated C contest. Yes, that code can work, but don't do that.

The books point all the arcane points of the language so that the reader can understand them. They're also full of commentary like "never do this".

Rather than most books which gloss over the "bad parts", which prevents people from fuller learning and leaves them to their own devices when they run across that stuff in the real world, YDKJS covers all the parts, and tries to use the deeper understanding as a tool and guide to making better-informed decisions about how to effectively write JS.

I think it's entirely unfair to suggest that covering "technical arcana" is the same thing as endorsing it.

I never once mentioned your books Kyle. I actually enjoy the parts that I've read. I was making a broader point that I have witnessed with the JS community: using technical arcana in production code as if it was a good thing. Just one example: https://github.com/twbs/bootstrap/issues/3057

Having played the "You Don't Know Jack" PC game from 1995 I found the title playful. From your preface I see you'll be doing exactly what I wanted from a book with this title. Going into all the areas I never would in a programming language. Not just how but why.

I agree with the GP though, on feeling some fatigue around people telling me I'm doing something wrong. Eating food, reading a book, tying my shoes, putting on a shirt. Anyhow it seems like you've just touched on that area a bit for this person. Experts don't like for Dummies books, not because they are rubbish, which they might be, but because owning or reading them visibly puts into question their knowledge and challenges their self image. In the same way someone might find your title a challenge to their knowledge, instead of seeing that you're interested in highlighting often overlooked things about JS.

For the love of God please don't put a giant headed person on your cover though. I've come to terms with every other book series having a positive quality with the exception of "Head First" and their distorted human cover photos. /rant

We all have our ticks when it comes to books and advertising around things we love.

> For the love of God please don't put a giant headed person on your cover though

These are what the covers of all the books in the series look like:



side note: my kickstarter for the books, 2 years ago, playfully used the bald head image to catch people's attention (never the intended branding). I soon afer got a friendly lawyer takedown notice from the folks who own the game. We worked it out, and the new branding was born. :)

I'd suggest, "The Tough Parts", as you mention in the preface.

Not sure who your target market is but as a professional developer who writes javascript daily, "The Tough Parts", piques my curiosity and sounds like an interesting challenge. "You Don't Know JS" evokes a more negative reaction.

fyi: there were some who felt that it would detract from or dillute the brand "the good parts", which is also an oreilly title.

Honestly, I don't care what the title is, the books are great. I've recommended them a number of times as newer resources than "the good parts" and raganwald's, and not one person has asked if I thought I was implying that they were dumb. If anything, the title serves as a compliment, since anything I do not know is something that I can learn. If you know everything already, then why are you looking at books which serve to teach?

That said, from a marketing perspective, they've got a great unique cover and a solid series title. If more than the original 5 come around in the future, they'll be easy to identify.

Sorry, but I think it should be clear from my comment that your title is indeed putting people off of reading your work at all. I don't doubt that it's worth reading, but I think you should consider that the title itself, accuracy aside, is dissuading more people than just me from reading your work.

The point isn't the quality of your work. It's your hook that's failing at least some of us to the point that you are potentially missing out on part of your target audience by default.

I understand and appreciate your feedback. Unfortunately, given that most of the series is done and half of them are already in print, it's too late to change.

I did have lengthy discussions with my book editor about the title and its potential to be off-putting to some. We wrangled with the decision awhile, but ultimately came to the conclusion that most would find it a mix/balance of playful, attention grabbing (in a sea of "JS: The Handy Guide" type titles), and challenging.

The title itself is supposed to be equal parts a joke and a serious commentary on what I consider to be a disturbing trend in JS specifically, which is either a false sense of confidence or (worse) an apathy to not care about what is not known.

Again, thank you for your thoughtful response and your feedback. I do regret that it's hit you the way it has. Perhaps at some point you may give it another shot.

really there are people who complains about the name of the book? it's clearly a joke.

Yup. The original talks were called "Advanced JS: The 'What You Need To Know' Parts" - and I'd much rather have a book with _that_ title on my desk, rather than one that makes it look like I'm reading a "...For Dummies" book.

Just putting it out there but knocking the "For Dummies" books based on the title is a bit pretentious. Sure, the title doesn't really make you look good but the books are often well written and informative. They have a great layout and serve well as introductory books.

In fact, I'd go as far as to say a lot of other books could learn a lot from the layout of the series. I've read many books and the dry books don't hold my attention for long. There is something to be said for books you just absorb.

I find the for Dummies books nearly unusable due to the evident required number of puns and homespun regular folks observations between every bit of actual technical info.

Yeah if For Dummies would just kill off the bad jokes it'd actually be easier to read. I don't like cringing through a book when I'm trying to learn something.

Maybe it's a play on how horrible the language is?

E.g. "You don't know what callback hell means. You don't know the horror of refactoring a weakly typed dynamic language. You are truly blessed for you don't know JS."

If the post was titled "In-depth look at Javascript" or something, I might've skip it. This title piqued my interest because I write Javascript for living for a long time and I was genuinely wondering what I don't know yet about the language.

and did you learn anything new? just wondering

There's a bunch of stuff here even folk with a few years may not know. See the generators section at https://github.com/getify/You-Dont-Know-JS/blob/master/async...

Learning JS is very different from other languages in that there's greater amounts of misinformation (lots of people know it, but prefer to use it as little as possible), and it changes faster. For example, in 2015:

- you won't find any Python new articles that tell you to use Python 1's 'strings' module

- You'll still see things like <script> tag soup, 'JS isn't object oriented', globals and patchable-ES3-isms in new JS articles.

Kyle Simpson is a well known JS speaker and O Reilly author - his books are a great source of current best practice.

I've read the book and even contributed a tiny tiny bit with issues in GH (the book is managed through GH). While I didn't learn much I did gain perspective about things so I'd say reading it was definitely worth my time.

Just wanted to say I appreciate any contributions (even "tiny tiny bit") you've made on GH. :)

Didn't read the whole thing yet :). But glancing through it it seems that I really have some stuff to learn about Javascript internals.

Likewise. I'll read the books on Safari Books Online using the work subscription, just to fill in the gaps. I'm pretty sure I will actually learn something.

Am I the only one that finds titles like this completely offputting?

No, you aren't, though FWIW I try to force myself to at least look at what's been submitted before commenting, in the spirit of not judging books by covers and all that.

In this case, I found very little to suggest that I do not, in fact, know JavaScript.

I'm also assuming that this is a very early draft of the material, but it could certainly benefit from the input of a good editor before any final publication.

> I found very little to suggest

Just curious what parts you looked at? Did you glance at the table of contents, or did you read full chapters? I certainly tried to reveal in every chapter several different things that, in my professional experience teaching JS to teams of developers, are commonly misunderstood or under-understood.

If you had any specific feedback on what I could have done better to live up to the title, tone, and mission of the book series, I'd be appreciative of it.

> very early draft

Depends on which book(s) you looked at. The series is 18 months old by now, with 6 titles. 5 of them are already "complete".

3 of them have already been edited and published (though publisher edits didn't necessarily all make it back into the free repo versions).

2 of them are in final editing and production stages, so they're still being cleaned up. The sixth one is still a very early and partial draft, so it's quite rough.

Just curious what parts you looked at? Did you glance at the table of contents, or did you read full chapters?

I skimmed through pretty much all of "Scope & Closures". I also looked through the first few chapters of "this & Object Prototypes" to see whether they were any better.

If you had any specific feedback on what I could have done better to live up to the title, tone, and mission of the book series, I'd be appreciative of it.

Sadly, with that title and your chosen goals, I think you left yourself no chance of meeting expectations right from the start. If you're going to tell me I don't know a language I've been using for 20 years, you'd better mean it in the sense that there is something significant and new in your book, perhaps some cutting edge developments in the language itself, or maybe an original application or new perspective on how to use what was already there. In this case, the closest you get in the books I looked at is touching on a few basics of ES6 -- nothing wrong with that, but hardly earth-shattering news to a professional who runs 6to5 (ahem sorry, Babel) every day.

Leaving aside the title, though, the material is often surprisingly narrow and imprecise if your intention is to teach the subtle details of JavaScript more thoroughly than many programmers might know them already.

Your opening paragraph of chapter 1 makes several debatable claims. For example, your characterisation of mutable variables as fundamental to nearly all programming languages immediately ignores alternatives such as purely functional or logic languages. That is perhaps an unfortunate choice given the current trends in JS libraries and frameworks, which in many cases are moving in that more declarative direction.

You then seem to conflate various concepts of scope, storage and lifetime throughout the book, and similarly do not seem to distinguish clearly and consistently between the concepts of identifiers, variables and values. In a language where closures and references to functions are used routinely and where you have some types passed by value but others effectively passed by reference, these kinds of distinctions matter, particularly to someone who has learned by osmosis or perhaps come from a background working with other programming languages, which seems to be a lot of your target audience here.

More generally, your terminology tends to drift away from the ECMAScript spec quite a lot, again making it less precise. Another example would be the opening paragraph of chapter 1 of "this & Object Prototypes", where you describe this as being a "special identifier keyword". By definition (in the spec) an identifier can't be a keyword, because an identifier is precisely an identifier name that is not a reserved word.

The most vague section of those I read was probably when you discuss closures in the final chapter, where I'm sorry to say you come across as rather unfamiliar with the concept yourself. Your usage is somewhat casual, unidiomatic even, not least in your definition of the term itself. Your explanation for where closures come from ("Closures happen as a result of writing code that relies on lexical scope. They just happen.") is just plain wrong, as evidenced by the fact that numerous languages with lexical scope do not provide closures as a language feature at all.

Sorry if this all seems a bit nit-picky, but you did just write a book about the importance of understanding the details and telling me I didn't know the language. :-)

It seems that you are offput by his title in a way that you feel he is personally challenging your knowledge and experience with JavaScript. I would guess that when he was writing and naming this series, he did not have someone with 20 years experience in mind. Seems like the series is geared towards someone with moderate experience.

I don't think the title is the big issue here. I don't think it's good, and clearly it does put some people off with its tone, but as you say, maybe at least some of those people aren't the intended target audience.

My stronger reservation is that these books have a lot of loose writing and give so much space over to asides or describing bad practices that someone who wasn't so experienced might still not know JS by the end, having missed the wood for the trees.

It's easy to be a critic. On the internet it's even possible to be a popular critic on a topic by admitting that one hasn't even read the subject of the criticism. In the world of male tech, one can easily achieve top common in an HN thread exactly for judging a book by its cover.

Anyone who doesn't have imposter syndrome hasn't tried the exercises in TAoCP.

> It's easy to be a critic.

In fact it's so easy that you can make a snide comment criticizing someone else's criticism and it will do really well if you throw in some unnecessary and ridiculous "male dominated" comment.

It wouldn't be a Hacker News thread without the top comment being an "Am I the only one...?"

It's probably a play on the "you don't know jack" trivia game.

More likely the common phrase, "you don't know jack shit".

the game was a play on that phrase, and my book title is a play on both. :)

I thought it was an homage to You Don't Know Jack (http://en.wikipedia.org/wiki/You_Don%27t_Know_Jack_%28video_...). I read the title as "You Don't Know Jack Squat," haha. I don't know if that was the author's intent, though.

Yes, that was my intended (subtle) joke.

That takes me back! Never thought I'd see that again...

Actually, I'm fine with these titles. It's the "Dummies", "Idiot's", etc titles that I find offensive.

My problem is (usually) ignorance, and I'm looking to correct that. If I'm an idiot, no book will fix that.

I think it says more about your ego imo. I mean you're getting worked up about a book's title to the point that you won't look at its content. Just because it insinuated you don't know said content.

It's amusing if anything.

""You don't know x." titles considered harmful."

no i really dont... and i dont care lol

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact