Klaus Komenda takes us through the history of development patterns of JavaScript demonstrating the pros and cons. Taking a typical JavaScript feature he starts with the old-school global functions method and iterates through a Singleton, Module Pattern, Revealing Module Pattern, Custom Objects and Lazy Function Definitions bringing the same feature up-to-date.
Ivo Wetzel covers some of the quirks of the JavaScript language. Some of these cause subtle bugs, some overturn conventional wisdom. It covers toString on numbers. Covers the advanced JavaScript features such as prototypal inheritance, this, closures, anonymous wrappers, type-casting, automatic semicolon insertion and hoisting of function and variable declarations.
Mike Alsup builds up to an elegant plugin development pattern for jQuery plugins, starting with requirements and adding a piece at a time. By explaining the reasoning and though behind each piece of the puzzle, it explains a number of important good parts of the JavaScript language
Christian Heilmann lays out seven rules to better unobtrusive JavaScript, including not making assumptions about JavaScript, the browser and the document. Work with structured markup. If you are traversing a document, maybe there's a solution that can take advantage of CSS's selector mechanism instead. Work with browsers and users. Better understanding of events, and playing nice with namespace, scope, and patterns. And of course, think about the next developer, so keep the code maintainable.
Simon Willison blogs about how JQuery won him over. From its faddish start based around CSS selectors (getElementsBySelector), and method chaining, Simon now sees the library in a new light. Simon shows how jQuery supports modern development best practice such as namespaces, giving a quick nod to the richness of jQuery selectors (DOM, CSS and XPath). JQuery's event handling looks natural and offers an event when the dom is ready. It exposes custom events for non-trivial Ajax requests. Simon's so convinced about jQuery that he's willing to overlook his rule that developers should know how a library works before using it.
Eric Miraglia explains Douglas Crockford's Module pattern, a way of creating encapsulated JavaScript functions that offer private and public methods and properties. It uses an anonymous function that returns an object containing our methods, and avoids the big issue of cluttering up the global namespace with global functions. Its based on the Singleton pattern.
Klaus Komenda discusses a number of ways of encapsulating JavaScript functions into objects and namespaces, and shows how to use each pattern. He covers Singletons, Douglas Crockford's Module Pattern and Custom Objects, building the same functionality with each technique.
Douglas Crockford's presentation on Advanced JavaScript. He covers topics such as inheritance, modules, debugging, efficiency and JSON.
Douglas Crockford explains why global variables in JavaScript are evil, causing unreliability and insecurity. JavaScript is a block of text that is eval'ed which leaves artifacts in the window's global object. He talks about why Yahoo! chose to use the global variable YAHOO all in uppercase.
First in a series of talks from Douglas Crockford about the JavaScript language. These talks cover the JavaScript language, from the history, the language, advanced features, platforms, standards and programming style. Talks about inheritance, using functions to build objects, closures, as well as the basic JavaScript syntax. Also covers code conventions. JavaScript is a language that requires discipline.
Matt Kruse's JavaScript Toolbox presents a number of excellent best practice ideas including: using var, feature detection, when to use square bracket notation, avoiding eval, referencing forms and form elements, avoiding the with keyword, using onclick instead of JavaScript pseudo-protocol, using unary + to type convert to numbers, avoiding document.all, not using HTML comments in script blocks, avoid cluttering the global namespace, avoiding prototype.js, avoiding synch Ajax calls, using JSON and the correct way to use script tags
Dustin Diaz discusses the Object Literal form of JavaScript, pointing out benefits such as better organisation of code in a namespace / wrapper.