You Don't Know JS: Async & Performance
B**O
First three chapters are worth the read, the rest not so much.
I am in probably Simpson's target group for this series. I'm a dev who mostly builds out the Service/API layer and needs to do some JavaScript on a semi-regular basis. I'm expanding that API experience into Node JS and diving more into front end frameworks. Being acutely aware of the nature of the platforms, I knew I'd need to be well versed in async to get any sort of performance out of it.The discussion of Promises made the book worth the read for me. Before I had a "good enough" idea of what was happening with Promises to use them, but there was still a little fog out there for me. After reading this book, I'm far more comfortable with using Promises, to the point they feel natural to me. Between that chapter and the first two chapters, I'd give the book 4 1/2 or 5 stars. Regardless of my thoughts on the rest of the book, those first chapters were well worth recommending the book. The only caveat I'd put on it is he throws around "inversion of control" pretty casually and almost always in a negative sense. Someone not that familiar with IoC would readily walk away from this book with the idea that it's *always* an anti-pattern to use IoC.However, the next three chapters (there's only six with several being fairly long) are a bit less impressive. There are too many distractions with *possible* enhancements for future JS frameworks and way too little on the current state of ES6. That's convinced me to avoid his "E6 and Beyond" title in hard copy although I'll probably skim the online version.The chapter on generators is over long and spends too much time showing how they can become confusing rather than spending the time focusing on good practice. This really could have been more succinct.The last two chapters are spent on performance and benchmarking but outside of WAY TOO MUCH ranting about not wasting your time on miniscule optimizations, everything was pretty shallow. It was more like a small collection of blog posts than a deep dive into the topics. What actual advice there was seemed to mostly be "just use these frameworks I suggest" than a deep dive.There's two appendices, the first discussing his own framework to build on async operations and another one with a few more patterns for async. Like most appendices, they're ok, but not the meat of the book.
I**T
Great but flawed in certain ways
Well I'm a big fan of Kyle, I have all 5 of these books, and also his book on functional js.But this is quite a tricky topic, and he does not tackle it perfectly. He does a good job, but there are some noteworthy flaws.First of all, on multiple occasions when talking about async events and so on he gets lost in quite long (10 page), and purely abstract story-telling type of explanations that simply did not seem necessary, well grounded, or that helpful to anyone beyond a sophore college student.That's a minor gripe, but it is worth noting.Secondly, and more importantly, his explanation on promises... it's 70 pages on promises, it's sophisticated, it goes into great depth, but it never once clearly states... what the basic promise syntax is. Particularly, how to create a new promise is never mentioned - i.e. what the point of the promise constructor is (p = new Promise(...) ) and how to use it. Bear in mind this was after 6-7 pages of abstract groundwork-laying and storytelling aimed at complete beginners. I had to look at his ES6 book / online resources to get the basic syntax. The whole time I was wondering... ok but what is a promise? And he keeps telling you you'll find out, but you never quite do.His code examples were also fairly confusing. It's a difficult topic but it was made more difficult from the ambiguity introduced by relying on various pre-built functions in place of constructing the promises, making the raw async callbacks, etc. This wasn't just a problem in the promises chapter, it was also a problem in callbacks and generators to some degree.After figuring out how promises work mechanically, and the role of the constructor & various callbacks, then rereading the book... it's a great book. Worth buying, full of depth and complexity, worth multiple reads to gradually master all that's packed into the book. But given the flaws mentioned, and a few others, I can't honestly give it 5 stars despite how much I love Kyles books.But I don't want to knock it too badly, because for advanced readers that know promises and other async techniques already, this is probably not a downside. It is however a design flaw considering the long winded beginner explanations. I'd give it 4.5 stars if I had the option.
A**S
Tremendous, but challenging.
This penultimate edition of the You Don't Know JS series explores everything async: Promises and Generators, mainly. As usual, the content was deep and the examples challenging (in this edition especially so). This book is certainly not for the feint of heart; if you're not an advanced developer and you don't know about these topics, you might consider reading some simpler introductory material online before tackling this.The one negative was the editing; there were many places where a sharp editor could have really clarified and simplified matters. There were a number of places where I'd read a section two or three times, and basically say to myself, "so Kyle's saying X Y Z," and then three paragraphs later see him say almost verbatim, "X Y Z." On the one hand it's always nice seeing that you correctly interpreted something difficult, but on the other a more straightforward presentation would have helped. And many other areas would have similarly benefited from a tightening up of the language, and stating more clearly and up front what the lessons to follow were.But to be clear, the above criticism should not for a moment prevent a senior JS developer from tackling this book. It'll be well worth your time, and you'll no doubt learn a tremendous amount.
E**Y
ECMA Script 6 promises [pun intended] a whole new world of programming
The larger part of this book covers two new ECMA Script 6 features - promises for asynchronous programming and generators. There have been implementations of promises before (e.g. in Angular) but now they become part of the language itself. Generators (similar to C# iterators, methods which yield control to the caller between returning values from a sequence) at first may seem out of place in a book on asynchronous programming but Kyle Simpson shows how they can be used in conjunction with promises for a very powerful and easier to use asynchronous programming model.The second, shorter, part of the book considers performance with an introduction to Web Workers and utilities for analysing performance. There are two sizeable appendices, the first considering an async helper library written by Simpson and available on GitHub, and the second discussing more advanced async programming patterns.As usual Simpson's exposition can be quite on the verbose side for those who just want to get to the point, but both promises and generators are quite involved topics and merit a lengthy discussion - even so it will take multiple readings to fully digest everything which is going on here. This is going to be a very valuable book indeed.
R**E
No callback is an island.
The first chapter emphasises the importance of the script environment or host system in scheduling tasks. Unfortunately, code examples there are presented as free-standing chunks, divorced from the context of any web page, browser or SVG graphic.I'm still reading, but the going is harder than it needed to be.
R**N
This is the most valuable book I have read so ...
This is the most valuable book I have read so far about this collection. If you struggle dealing with callbacks and promises, here is where you will find your answers!
A**R
Five Stars
No problems.
M**S
Five Stars
:)
Trustpilot
Hace 1 mes
Hace 2 semanas