javascript: the who, what, when, where, why, & how

Post on 09-May-2015

481 Views

Category:

Technology

5 Downloads

Preview:

Click to see full reader

TRANSCRIPT

WHO, WHAT, WHEN, WHERE, WHY

JavaScript

About Me

Authored tamufeed.js GoMobile Tech TeamResponsive Web

Design

what

what

JavaScript is a lightweight, interpreted, object-oriented language with first-class functions.

the server side

1994 Netscape Enterprise Server1996 Microsoft IIS 3.0Today: Node.js

the client side

Adobe Flash, Google Chrome, Nexus 7, Firefox, Opera, Safari, iPad, Kindle PaperWhite, Windows 8, Internet Explorer 9, Windows Phone

The Language & Its Libraries

Like Java and .NET, JavaScript has its go-to libraries

Libraries! extend the present, polyfill the past, and pioneer the future

what it’s not

vbscriptpython

CoffeeScript

Google DartMicrosoft TypeScript

when

when

1995 Netscape 2.01996 IE 3.01997 Ecma-262 1999 Ecma-262 Ed.32009 Ecma-262 Ed.52011 Ecma-262 Ed.5.1

when

When do you JavaScript?

where

Who’s Who?

Douglas Crockford Y! http://www.crockford.com Brendan Eich N. @BrendanEich

http://BrendanEich.com John Resig jQ @jeresig http://ejohn.org Nicholas Zakas Y! @slicknet

http://www.nczonline.net Stoyan Stefanov Y! @stoyanstefanov

http://www.phpied.com Rebecca Murphy B! @rmurphey http://rMurphey.com Addy Osmani G. @addyosmani

http://addyosmani.com

why

why

Pervasive: It’s everywherePerformance: Browser Wars for the winMutable: JS lets you do stuffCommunity: Welcome to brogrammer culture MashupsCross Platform: Apps for Windows 8, to

iPhone, to AndroidCircumvent Your CMSResponsive Web Design

BEST PRACTICES

how

some best practices

best practices

Use meaningful variable namesWrite narrative code

best practices

Use object literals And JSON notationwhenever possible

best practices

Don’t pollute the global namespace.

best practices

Unobtrusive JavaScript

Code is decoupled from markup; only binding of behavior to DOM is the CSS selector.

Styles are decoupled from code (antipatterns: Twitter Badge JS, Titanium 2)

best practices

Use strict mode. Stick to The Good Parts

best practices

the module pattern

best practices

Isolate & minimize DOM access

best practices

Patterns

best practices

Enhance progressively and degrade gracefully.

best practices

Prefer JS libs over HTML5 API over ES5.1

best practices

Compress (e.g. YUI Compressor)Concatenate to avoid network latency &

HTTP overheadSynchronous JavaScripts blocks the browser,

so load last on the page

best practices

Know your JS engines when testing.

top related