Pulling off Privates in JavaScript

*
Proposal
Short Form
Advanced

Excerpt

Private properties are not built-in to the JavaScript language, but can be attained through various mechanisms in the language. We will explore tricks to associate private state with objects while taking full advantage of prototypal inheritance.

Description

Private state is not built-in to the JavaScript language, but it is attainable through various mechanisms in the language. Two of the common approaches are to simulate privates with underscore prefixes and the module pattern. Neither of these approaches is ideal. Underscores don’t encapsulate and the module pattern breaks the prototypal inheritance model of JavaScript. Lucky for us, JavaScript was designed as a highly flexible language and is easy to monkey-patch to our heart’s content. In this presentation we will explore the problems with common techniques and some alternative approaches which allow encapsulation while taking full advantage of prototypal inheritance. We’ll also explore some possibilities on the horizon for the upcoming 6th edition of ECMAScript.

Speaking experience

No conference speaking experience, but I do have experience teaching high school :). There is a sample video of me teaching JavaScript basics here: http://www.youtube.com/watch?v=giJV6boOLxU

Speaker

  • Nathan wall 2

    Nathan Wall

    AppNexus

    Biography

    As a Software Engineer for the User Interface team, Nathan works on AppNexus’ UI framework. Nathan has extensive open source experience, having developed the joi JavaScript Framework (joijs.com), an object-oriented framework for developing, implementing, and maintaining robust web applications. Recently, he has been developing a next-generation JavaScript framework called tempo (github.com/joijs/tempo) targeting ECMAScript 5 & 6 as well as various other open source projects (github.com/Nathan-Wall). Before joining AppNexus, Nathan taught math to high school students at the Memphis Health Careers Academy where he developed ClassHub, an interactive classroom response system. Nathan has a Bachelor’s Degree in Mathematical Sciences from the University of Memphis.