How often do you hear people say things like this? Our JavaScript is a mess, but we're thinking about using [framework of the month].
Like it or not, JavaScript is not going away. No matter what framework or "compiles-to-js" language or library you use, bugs and performance concerns will always be an issue if the underlying quality of your JavaScript is poor. Rewrites, including porting to the framework of the month, are terribly expensive and unpredictable. The bugs won't magically go away, and can happily reproduce themselves in a new context. To complicate things further, features will get dropped, at least temporarily.
The other popular method of fixing your JS is playing "JavaScript Jenga," where each developer slowly and carefully takes their best guess at how the out-of-control system can be altered to allow for new features, hoping that this doesn't bring the whole stack of blocks down. This book provides clear guidance on how best to avoid these pathological approaches to writing JavaScript:
Recognize you have a problem with your JavaScript quality. Forgive the code you have now, and the developers who made it. Learn repeatable, memorable, and time-saving refactoring techniques. Apply these techniques as you work, fixing things along the way. Internalize these techniques, and avoid writing as much problematic code to begin with. Bad code doesn't have to stay that way. And making it better doesn't have to be intimidating or unreasonably expensive.
Good but not that good! It takes a few months for me to finish this. First six chapters were good both in terms of comprehensiveness and topics it has covered. However last chapters were too complicated to understand, for me at least. I may get back to it later in the future.
Simplified material on testing, refactoring, design patterns, and functional programming to give the reader a basic overview of each and a taste of what they have to offer.
Has some misunderstandings about basic JavaScript, but nothing that prevents you from getting something from the material. Also, the Sanctuary JS material is already out of date, but that comes with the territory of using a library still in beta. Thankfully, it is easy enough to convert and gets you digging into their documentation.
Overall, a recommended read for people who believe that you can only solve problems in a certain subset of ways in JavaScript.
Using one example of poor code - a Naive Bayesian Classifier - and taking it through several styles of test-driven refactoring (procedural to OO to functional) this is an inspirational book for anyone working in a poorly served legacy code base. Change is possible!
Presents an excellent strategy to approach refactoring in a variety of Javascript paradigms, with plenty of detail in all the right places. Strongly recommended!