CapitolJS Conference 2011 Schedule and Overview

Table of Contents

Overview

Schedule

9:15 AM Douglas Crockford: JavaScript and the Brain

Language requires precision

Why jslint

Reiteration of fall-through

Canonization reqiures clarity

Example: canonization of the bible with constantine required introduction of punctuation and spacing.

No space before ( with invocation

Don't use forms that can't be distinguished from errors

Don't use complicated features when simplier will do

Make your programs look like what you do

Write in the language you're writing in

++ is hardly optimal when looking at += 1

x++ vs. ++x ; pre-post increment difference forces a code reviewer to go back and check all code from the author.

var a = b = 0

This actually become a global issue:

b = 0; var a = b;

Example:

function multAssign() { var a = b = 0; console.log('a' + a); console.log('b' + b) } ; multAssign(); console.log('b' + b)

Style demands you don't use all

CoffeeScript

Wished that JavaScript looked more like CoffeeScript but debugging code

Why do language designers add bad parts

Language is an experiment…

JavaScripts combination of lambdas and prototypes worked well.

Not all worked well.

9:45 AM Ben Combee: webOS

Architectural discussion

WebKit, Node.js Service Runtime, webOS Services

Enyo

Thisi s for full page applictions. js over html.

Node.js

Used as part of the service bus.

10:30 AM Nicholas Zakas: High Performance JavaScript

UI Thread

Paint operations are queued since there could be a number of UI changes queued from the event.

No single JavaScript job should

Per Nielson: .1s is the limit to a user sense of instantaneous.

Don't interrupt UI updates with script calls

Download doesn't block with dynamic load for document.createElement.

<script defer src=''>

Avoid slow load: dynamically, deferred, asycn

Downloaded but not run until all UI is completed.

<script async src=''>

Runs as soon as possible. Order isn't preserved (by design).

Technique 1: Split execution setTimeout

todo = items.concat(); start = +new Date()

Technique 2: Script Yeilding

process.nextTick()

msSetImmediate: // MSIE 10 setImmediate(function(0 {

});

https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/setImmediate/Overview.html

Technique 3: Web Workers

new Worker…

self.onmessage…

Based in part on http://www.html5rocks.com/en/tutorials/workers/basics/

Repsonsive: small UI, small JS, small UI…

Handling document.write after page load

Overwrite document.write to handle load…

Recommendation: look at WebKit source

11:00 AM Mikeal Rogers: node.js module tour

Node core doesn't have all features you might reasonably want

This falls to external libraries

npm has 10 to 30 new updates per day

npm utilies

% npm explore request 0 master[2708668] 11:10:53

Exploring usr/local/lib/node.npm/request/active/package Type 'exit' or ^D when finished

npm libraries

http://search.npmjs.org/

underscore 216 coffee-script 175 request 141 express 141 connect 130 optimist 127 colors 90 uglify-js 85 socket.io 85 redis 76

optimist

https://github.com/substack/node-optimist

Mentioned as the best options parser.

----------–— 1.js var optimist = require('optimist'); console.log(optimist.argv); ----------–— 1.js

$ node 1.js asdfasdfasd asdf asdf { _: [ 'asdfasdfasd', 'asdf', 'asdf' ], '$0': 'node ./1.js' }

request

Advanced HTTP client.

request.pipe() is a core feature.

socket.io

11:45 AM Jed Schmidt: Code Golf

http://140byt.es/

function (a) { new Option(a).innerHTML; }

@jedschmidt on 140byt.es

1:00 PM Mike Taylor: Event Protocols

Feature detection

1:30 PM Rebecca Murphey: Mulberry

Mobile and web apps need to integrate

2:15 PM Alex Sexton:

Types of Cross Domain Communication

3:15 PM Joe McCann: Improving HTML5 Development with Node

r.js (requirejs)

node-imageable (image resizing)

commander (CLI apps)

4:30 PM Pamela Fox: Client-Side APIs

Covered cross-domain

4:30 PM Progressive Mobile

Touch events not supported

Fixed position cannot work by default

View port requires change in design mindset

Modernizr supports a script loader

5:00 PM Brendan Eich

ES6

Still have arguments

Proxies in V8

Membranes

Iterators and generators

Yeild:*

Shallow continuations

Need to see a yeild to see if continuation

Typed arrays

Quasi-literals: supported by back-ticks

Functions might only have block labda eval

TC39 is a steward for the standard

7:00 PM Zappos' Closing Party

Author: Jason Walsh

j@wal.sh

Last Updated: 2024-08-02 10:11:40