JS.Next: A Managers Guide
by Aaron Frost
Copyright 2015 OReilly Media, Inc. All rights reserved.
Printed in the United States of America.
Published by OReilly Media, Inc. , 1005 Gravenstein Highway North, Sebastopol, CA 95472.
OReilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://safaribooksonline.com). For more information, contact our corporate/institutional sales department: 800-998-9938 or corporate@oreilly.com .
- Editor: Meg Foley
- Production Editor: Matthew Hacker
- Proofreader: Amanda Kersey
- Interior Designer: David Futato
- Cover Designer: Ellie Volckhausen
- Illustrator: Rebecca Demarest
- May 2013: First Edition
- April 2015: Second Edition
Revision History for the Second Edition
- 2015-03-27: First Release
The OReilly logo is a registered trademark of OReilly Media, Inc. JS.Next: A Managers Guide, the cover image, and related trade dress are trademarks of OReilly Media, Inc.
While the publisher and the author have used good faith efforts to ensure that the information and instructions contained in this work are accurate, the publisher and the author disclaim all responsibility for errors or omissions, including without limitation responsibility for damages resulting from the use of or reliance on this work. Use of the information and instructions contained in this work is at your own risk. If any code samples or other technology this work contains or describes is subject to open source licenses or the intellectual property rights of others, it is your responsibility to ensure that your use thereof complies with such licenses and/or rights.
978-1-491-92019-0
[LSI]
Preface
Writing this book was extremely fun and proved to be a helpful exercise. Researching and describing each topic was a process that lasted about two and a half years. When Simon (@simonstl) and Mike (@mikeloukides) approached me about the idea, I wasnt sure that I would be able to deliver what they were asking for. Their vision was to explain ECMAScript 6 in a way that non-developers would understand it. Additionally, they wanted to help everyone understand the importance of adopting the new syntax into their current projects, as opposed to waiting years for certain parts of the Web to catch up. Much like steering a donkey with a carrot on a stick, Simon and Mike helped steer my efforts. Without them, much of what was written wouldnt be. I appreciate all of their mentoring and guidance.
Once I finally understood the direction in which we needed to go, I simply needed time. A special thanks goes to my wonderfully understanding wife (Sarai) and to my four children (Naomi, Joceline, Ryan, and Owen). Family life is already a lot of work. Having a husband/dad that is busy writing a book only adds to it. Each of them helped me race to get this finished in time for FluentConf 2015. Thank you.
Everyone made a very serious effort to disguise how sleep deprived I was when finishing this. A special thanks to the inventors/makers/distributors of Diet Mountain Dew and Mio Energy Drops. While the ideas are my own, many of the words used to spell out my ideas were heavily fueled by caffeine from these sources.
To my friends and colleagues who helped out, you know who you are, thank you! Chad the knife (@chadmaughan) and Tom ( @tvalletta ), thank you for mentoring me and helping my solidify some of the ideas expressed here. Mom (@marlli53), Neal (@NealMidgley), Steveo (@steveolyo), Ted the head (@jsbalrog), and Tayler (@taylersumms). These are my people who read the pages when they were fresh off the press. Each of them took part in ensuring the quality of the text.
And a very special thanks to each of the members of the TC39. This book is only possible because of their efforts. While the JavaScript community eagerly await the ES6 updates, the members of the TC39 remain focused as they continue their daily effort of solidifying the ES6 specification. I feel lucky that I have been able to work directly with a handful of them. While I want to thank each of them, the following are the members who have directly had a hand in helping my efforts: Dave Herman (@littlecalculist), Allen Wirfs-Brock (@awbjs), Brendan Eich (@BrendanEich), Rafael Weinstein (@rzweinstein), Rick Waldron (@rwaldron), and Alex Russell (@slightlylate). Note to whomever is running the@FakeAlexRussellaccount: youre brilliant!

Chapter 1. You Cant Afford to Avoid ES6
ECMAScript 6 is a big deal. ECMAScript, everyones favorite scripting API, hasnt had an update this significant since it was initially formalized. Some people may feel overwhelmed as they browse through the impressive list of new features. Each was carefully considered, discussed at length, and selected for adoption into the official API. Ours is the task of rolling out these new features, bringing ES6 to our teams and to our projects.
But exactly how are we do that? How do we take these new features and concepts and infuse them into the brains of our developers? How can we inject this new power into our current projects? Just as important, and possibly more so, is when should we do this?
You may feel that you cant afford to implement these features in your world. Some of you may prove yourselves to be extremely talented as creating reasons why you cant afford it at this time. I am here to tell you that you cant afford not to. As you read on, consider yourself warned: the content that follows is highly controversial.
Note
While the main audience of this book is composed of development management, I am sure that a handful of developers will find their way here as well. If you are a developer, welcome! If you are in management, I hope that you enjoy the ride.
The remaining sections in this chapter will cover various reasons for adopting ES6 into your current and future projects. Although not a complete list of reasons, it should help show that in the long run, it will cost more to avoid ES6 than to embrace it.
Innovation Debt
When talking about debt in software development, most people will talk about technical debt. Technical debt reflects the imperfect and sometimes dangerous state of your code and processes. As deadlines approach, optional features and maintenance time can get cut from the schedule. Without enough time to properly maintain code and processes, you will inevitably have to watch as your technical debt grows. Increased technical debt is something that all teams, except perhaps those with infinite resources, face regularly.
There is, however, another type of development debt that is constantly accruing: innovation debt. The term comes from Peter Bell, an amazing author, speaker, and innovator. Peter provides a concise definition:
Innovation debt is the cost that companies incur when they dont invest in their developers.
Like technical debt, innovation debt can spiral out of control if left unchecked, possibly threatening the existence of the company.
Note
If you have time, please visit Peters blog and read his full explanation of the definition.
Imagine your CEO tells you that she needs a new and modern app (that your team doesnt know how to build), built with very modern tools (that your team doesnt know how to use), and deployed using very modern build tools (that your team doesnt know how to configure). What would you say? Given the state of your team, what are the odds of getting it done right?