While the class keyword might be new in ES6, the concept of classes, inheritance, and privacy has been tackled in a myriad of ways. This talk will cover what options are available now, how you might choose between them, and what's coming down the pipe in future versions of Javascript.
This talk will start with a discussion of why classes and inheritance might (or might not!) be important to your project -- be it a big Javascript app, a quick weekend hackathon project, or a widely-adopted library. I'll then move on to a brief overview of how the problem was tackled before ES5 (with prototypal inheritance, naming conventions, Crockford-style constructors, and libraries like Prototype), a tour through new ES5 and ES6 features (the class keyword, and how Symbol and WeakMap can provide privacy), and finally look forward to ES7 and beyond (standards-track proposals like decorators and privacy keywords). I'll also cover how this is handled in compile-to-javascript languages like Typescript, but the focus will primarily be on standard Javascript techniques.
While the
class
keyword might be new in ES6, the concept of classes, inheritance, and privacy has been tackled in a myriad of ways. This talk will cover what options are available now, how you might choose between them, and what's coming down the pipe in future versions of Javascript.This talk will start with a discussion of why classes and inheritance might (or might not!) be important to your project -- be it a big Javascript app, a quick weekend hackathon project, or a widely-adopted library. I'll then move on to a brief overview of how the problem was tackled before ES5 (with prototypal inheritance, naming conventions, Crockford-style constructors, and libraries like Prototype), a tour through new ES5 and ES6 features (the
class
keyword, and howSymbol
andWeakMap
can provide privacy), and finally look forward to ES7 and beyond (standards-track proposals like decorators and privacy keywords). I'll also cover how this is handled in compile-to-javascript languages like Typescript, but the focus will primarily be on standard Javascript techniques.