All events
Silicon Valley Code Camp : October 8th and 9th, 2011.Session

JavaScript Code Organization and Encapsulation

  • When 10:45 AM Sunday
  • Where 3525

About This Session

UPDATE - Slides now available at:
http://www.multiwidget.com/JavaScript_Organization_and_Encapsulation.pdf


Follow my new account on Twitter for JS, Ruby, HTML5, and productivity news.
Twitter handle: @svicalifornia

As front-end web applications grow, JavaScript code can become complex and difficult to modify and maintain. Global variables, functions, and objects often become interconnected in unanticipated ways, increasing the risk of unintended side effects with each future change. JavaScript code mixed into server-side HTML templates adds additional complexity that can be hard to follow.

This talk will present ideas for organizing, encapsulating, and simplifying JavaScript code, including:
  • creating JavaScript objects and classes with truly private members, using Douglas Crockford's module pattern and classical inheritance constructs provided by Dean Edward's Base.js, Prototype, and MooTools;
  • abstracting JavaScript code from HTML templates, CSS styling, and the DOM;
  • designing with polymorphism (duck typing) for code reuse and simplicity; and
  • using JSLint to identify problems in your code before runtime.
Learn how to get your web application code back in shape and avoid code organization problems on new projects.
  • Time 10:45 AM Sunday
  • Room 3525

The Speaker(s)