jsday - it's not you, it's me (or how to avoid being coupled with a javascript framework)

174
“It’s not you, It’s me”

Upload: marco-cedaro

Post on 29-Oct-2014

10 views

Category:

Technology


3 download

DESCRIPTION

General purpose Javascript frameworks are the ones that made the language popular in the past, but right now it is a risk to think about our application development and architecture just in relation to our favorite framework. This talk highlights risks and suggest some techniques (from design patterns to snippet of code) to avoid being coupled to a specific framework

TRANSCRIPT

Page 1: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

“It’s not you, It’s me”

Page 2: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

How to avoid being coupled with a Javascript

framework.

Page 3: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Even if you loved it.

Even if it was the right one.

Page 4: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Even if you loved it.

Even if it was the right one.

Page 5: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Hello, who’s speaking?

Marco Cedaro @cedmax

Page 6: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

About me...

Frontend Cowboy Nicola Vitto Jr.

Hello, who’s speaking?

Marco Cedaro @cedmax

Page 7: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

About me...

Frontend Cowboy Nicola Vitto Jr.

Javascript PervertRoberto Felter

Hello, who’s speaking?

Marco Cedaro @cedmax

Page 8: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

About me...

Frontend Cowboy Nicola Vitto Jr.

Javascript PervertRoberto Felter

Marco.. who?basically anyone else

Hello, who’s speaking?

Marco Cedaro @cedmax

Page 9: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Actually I am:

a Frontend Developer at Spreaker.com

Hello, who’s speaking?

Marco Cedaro @cedmax

Page 10: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Actually I am:

a Frontend Developer at Spreaker.com

Conference organizer with From The Front

Hello, who’s speaking?

Marco Cedaro @cedmax

Page 11: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Actually I am:

a Frontend Developer at Spreaker.com

Conference organizer with From The Front

and a javascript pervert

Hello, who’s speaking?

Marco Cedaro @cedmax

Page 13: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

http://welovestyles.com/love-pictures/http://everyoneneedsanalgonquin.com/2012/03/25/fruit-season/

Page 14: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

General Purpose Frameworkshttp://geekadelphia.com/2008/05/01/sick-ink-brah-alex-hillmans-geeky-love-hate-tattoos/

Page 15: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

ABOUT LOVE #1

Love is a given, hatred is acquired.Doug Horton

Page 16: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Definition

frame·work n.

A structure for supporting or enclosing something else, especially a skeletal support used as the basis for something being constructed.

gen·er·al-pur·pose adj.

Designed for or suitable to more than one use; broadly useful.

Page 18: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Once upon a time

code snippet

“dhtml”

if (document.all)

http://creativecriminals.com/print/scotch-tape-beyond-strong/

Page 19: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Then

Page 20: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Then

Page 21: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Then

Page 22: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Then

Page 23: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Then

Page 24: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

That awkward moment...

Page 25: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

That awkward moment...

Page 26: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Now

Page 27: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Why did they get so popular?

DOM access

Cross browser implementation

Shorthands

Community scripts

Page 28: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Drawbacks

Page 29: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Community Support

Page 30: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Updating is a mess

Page 31: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Long life cycle websites

General purpose framework may seem the right solution to handle complexity

http://sproutsocial.com/insights/2011/11/how-to-iphone-ipad-friendly/ - http://pressganger.blogspot.it/2012/03/blog-progress-update.html - http://news.brothersoft.com/internet-explorer-10-focuses-html5-improves-performance-16036.html

Page 32: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Long life cycle websites

General purpose framework may seem the right solution to handle complexity

What about updates?

clientside environment is always changing

http://sproutsocial.com/insights/2011/11/how-to-iphone-ipad-friendly/ - http://pressganger.blogspot.it/2012/03/blog-progress-update.html - http://news.brothersoft.com/internet-explorer-10-focuses-html5-improves-performance-16036.html

Page 33: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Long life cycle websites

General purpose framework may seem the right solution to handle complexity

What about updates?

clientside environment is always changing

How many patches did you make in your

framework over years?

http://sproutsocial.com/insights/2011/11/how-to-iphone-ipad-friendly/ - http://pressganger.blogspot.it/2012/03/blog-progress-update.html - http://news.brothersoft.com/internet-explorer-10-focuses-html5-improves-performance-16036.html

Page 34: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Short life cycle websites

Counterintuitively situation is even worse

http://www.cnbc.com/id/46994692/The_Worst_Jobs_for_2012 - http://indiatransportportal.com/india-transport-studies/

Page 35: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Short life cycle websites

Counterintuitively situation is even worse

Less analysis and foresight

http://www.cnbc.com/id/46994692/The_Worst_Jobs_for_2012 - http://indiatransportportal.com/india-transport-studies/

Page 36: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Short life cycle websites

Counterintuitively situation is even worse

Less analysis and foresight

Did you make any patch in your

framework over years?

http://www.cnbc.com/id/46994692/The_Worst_Jobs_for_2012 - http://indiatransportportal.com/india-transport-studies/

Page 37: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Our job is evolving

Page 38: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

It's the browser, baby

Page 39: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

It's the browser, baby

Page 40: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Some of them are just not built for

maintainability

Page 41: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Some of them are just not built for

simplicity

Page 42: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Some of them are just not built for

love

Page 43: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Code Portability

Page 45: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

case study

Own scripts built on a known framework

Brand new website with responsive design

http://www.naba.it/newsletter_09_10/naba_n184.html - http://sevenspark.com/product/agility-responsive-minimal-html5-template/ - http://middleclasshell.com/republicans-ignore-catholics-when-it-comes-to-unemployment-benefits

Page 46: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

case study

Own scripts built on a known framework

Brand new website with responsive design

same old frw over 3g?or rewrite all scripts?

http://www.naba.it/newsletter_09_10/naba_n184.html - http://sevenspark.com/product/agility-responsive-minimal-html5-template/ - http://middleclasshell.com/republicans-ignore-catholics-when-it-comes-to-unemployment-benefits

Page 47: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

$LAB .script("jquery.js").wait() .script("scripts.js")

$LAB .script("xui.js").wait() .script("scripts.js")

Desktop

Mobile

Page 48: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

$LAB .script("jquery.js").wait() .script("scripts.js")

$LAB .script("xui.js").wait() .script("scripts.js")

Desktop

Mobile

Page 49: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

It's the browser, baby

Page 50: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

and the deviceshttp://www.newfangled.com/mobile_technology_and_web_enhanced_devices

Page 51: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

and the deviceshttp://www.newfangled.com/mobile_technology_and_web_enhanced_devices

Page 52: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

We need our code to bePORTABLE

Page 53: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

We need our code to bePORTABLE

but how?

Page 54: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

DISCLAIMER

http://www.destructoid.com/disappointment-a-postmortem-of-l-a-noire-224486.phtml

Page 55: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Go Vanillahttp://s394.photobucket.com/albums/pp28/cojohn55/?action=view&current=tasty-thursday-187-lets-get-naked.gif&mediafilter=images

Page 56: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

LOVE FACT #2

What is known as a French Kiss in the English speaking world is called an

English Kiss in France.

Page 57: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Loops

Page 58: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

_.each(items, function(item, i) { [...]});

Ext.each(items, function(item, i) { [...]});

$.each(items, function(i, item) { [...]});

items.each(function(item, i) { [...]});

Page 59: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

_.each(items, function(item, i) { [...]});

Ext.each(items, function(item, i) { [...]});

$.each(items, function(i, item) { [...]});

items.each(function(item, i) { [...]});

Page 60: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

_.each(items, function(item, i) { [...]});

Ext.each(items, function(item, i) { [...]});

$.each(items, function(i, item) { [...]});

items.each(function(item, i) { [...]});

Page 61: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

$.each(items, function(i, item) { [...]});

Page 62: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

for (var i = 0; i < items.length; i++) { [...]};

$.each(items, function(i, item) { [...]});

Page 63: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

for (var i = 0; i < items.length; i++) { [...]};

$.each(items, function(i, item) { [...]});

Page 64: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

operations per second (higher is better)

Page 67: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

operations per second (higher is better)

Page 68: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

operations per second (higher is better)

Page 69: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

for (var i = 0; i < items.length; i++) { [...]};

Page 70: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

for (var i = 0; i < items.length; i++) { [...]};

var len = items.length;for (var i = 0; i < len; i++) { [...]};

Page 71: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

for (var i = 0; i < items.length; i++) { [...]};

var len = items.length;for (var i = 0; i < len; i++) { [...]};

Page 72: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

for (var i = -1; ++i < items.length;) { [...]};

Page 73: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

for (var i = -1; ++i < items.length;) { [...]};

Page 74: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

for (var i = -1; ++i < items.length;) { [...]};

Page 75: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

for (var i = -1; ++i < items.length;) { [...]};

var len = items.length;for (var i = -1; ++i < len;) { [...]};

Page 76: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

for (var i = -1, item;item = items[++i];) { [...]};

Page 77: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

for (var i = -1, item;item = items[++i];) { [...]};

Page 78: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

for (var i = -1, item;item = items[++i];) { [...]};

Page 79: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

var i = 0;while (i < items.length) { [...] i++;};

Page 80: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

var i = 0, len = items.length;while (i < len) { [...] i++;};

Page 81: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Vanilla Loops

PROS

A lot of options

Performance Benefits

CONS

mmm...

Page 82: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

wait, what?too many characters??

http://screenrant.com/game-thrones-episode-7-recap-spoilers-benm-117660/

Page 84: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

...and minify

http://www.destentor.nl/algemeen/show/3347136/Minime-sleept-site-voor-rechter-om-sexvideo.ece

Page 85: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Yeah, baby, yeah

http://www.destentor.nl/algemeen/show/3347136/Minime-sleept-site-voor-rechter-om-sexvideo.ece

Page 86: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Context Binding

Page 87: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

var conf = { name: "jsDay",

clicked: function(event) { alert(this.name); }}

myElm.onclick = conf.clicked;

Page 88: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

var conf = { name: "jsDay",

clicked: function(event) { alert(this.name); }}

myElm.onclick = conf.clicked;

Page 89: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

var conf = { name: "jsDay",

clicked: function(event) { alert(this.name); }}

myElm.onclick = conf.clicked;

Page 90: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

var conf = { name: "jsDay",

clicked: function(event) { alert(this.name); }}

myElm.onclick = conf.clicked;

Page 91: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

var conf = { name: "jsDay",

clicked: function(event) { alert(this.name); }}

myElm.onclick = conf.clicked;

Page 92: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

conf.clicked.bind(conf)

conf.clicked.createDelegate(conf);

$.proxy(conf.clicked, conf);

conf.clicked.bind(conf)

Page 93: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

conf.clicked.bind(conf)

conf.clicked.createDelegate(conf);

$.proxy(conf.clicked, conf);

conf.clicked.bind(conf)

Page 94: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

conf.clicked.bind(conf)

conf.clicked.createDelegate(conf);

$.proxy(conf.clicked, conf);

conf.clicked.bind(conf)

Page 95: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

myElm.onclick = (function(context){ return function(){ conf.clicked.apply(context, arguments) }})(conf);

Page 96: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

myElm.onclick = (function(context){ return function(){ conf.clicked.apply(context, arguments) }})(conf);

Page 97: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

myElm.onclick = (function(context){ return function(){ conf.clicked.apply(context, arguments) }})(conf);

Page 98: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

myElm.onclick = (function(context){ return function(){ conf.clicked.apply(context, arguments) }})(conf);

Page 99: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

myElm.onclick = (function(context){ return function(){ conf.clicked.apply(context, arguments) }})(conf);

Page 100: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

myElm.onclick = (function(context){ return function(){ conf.clicked.apply(context, arguments) }})(conf);

Page 101: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

argh, my eyes are bleeding..

http://www.accessexcellence.org/AE/mspot/tbs/episode3a/ep3a06.php

Page 102: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

MyNS.bind = function(func, context) {    return function() {        func.apply(context, arguments);    };}

Page 103: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

MyNS.bind = function(func, context) {    return function() {        func.apply(context, arguments);    };}

Page 104: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

MyNS.bind = function(func, context) {    return function() {        func.apply(context, arguments);    };}

Page 105: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

MyNS.bind = function(func, context) {    return function() {        func.apply(context, arguments);    };}

Page 106: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

MyNS.bind = function(func, context) {    return function() {        func.apply(context, arguments);    };}

Page 107: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

MyNS.bind = function(func, context) {    return function() {        func.apply(context, arguments);    };}

myElm.onclick = MyNS.bind(conf.clicked, conf);

Page 108: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

MyNS.bind = function(func, context) {    return function() {        func.apply(context, arguments);    };}

myElm.onclick = $.proxy(conf.clicked, conf);

myElm.onclick = MyNS.bind(conf.clicked, conf);

Page 109: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

AAAARGGGHHH

http://digitivity.org/1044/rss-kill-your-productivity-make-you-insane-waste-time

Page 110: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

MyNS.bind = function(func, context) {    

}

myElm.onclick = MyNS.bind(conf.clicked, conf);

return function() {    return func.apply(context, arguments);};

Page 111: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

MyNS.bind = function(func, context) {    

}

myElm.onclick = MyNS.bind(conf.clicked, conf);

$.proxy(func, context);

Page 112: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Design Patternshttp://failblog.org/vote

Page 113: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Wrapper Pattern

Page 114: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Wrapper Pattern

http://www.pinkblog.it/post/8396/comprare-i-preservativi-vi-imbarazza

Page 115: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

var AwesomeEffect = function(id, config){ var default = { delay: 0, duration: 500, transition: "easeOut", }; [...]}

var myEff = new AwesomeEffect("myId", { duration: 100, delay: 1000});

//{delay: 1000, duration:100, transition: "easeOut"};

Page 116: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

var AwesomeEffect = function(id, config){ var default = { delay: 0, duration: 500, transition: "easeOut", }; [...]}

var myEff = new AwesomeEffect("myId", { duration: 100, delay: 1000});

//{delay: 1000, duration:100, transition: "easeOut"};

Page 117: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

var AwesomeEffect = function(id, config){ var default = { delay: 0, duration: 500, transition: "easeOut", }; [...]}

var myEff = new AwesomeEffect("myId", { duration: 100, delay: 1000});

//{delay: 1000, duration:100, transition: "easeOut"};

Page 118: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

var AwesomeEffect = function(id, config){ var default = { delay: 0, duration: 500, transition: "easeOut", }; [...]}

var myEff = new AwesomeEffect("myId", { duration: 100, delay: 1000});

//{delay: 1000, duration:100, transition: "easeOut"};

Page 119: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

var AwesomeEffect = function(id, config){ var default = { delay: 0, duration: 500, transition: "easeOut", }; [...]}

var myEff = new AwesomeEffect("myId", { duration: 100, delay: 1000});

//{delay: 1000, duration:100, transition: "easeOut"};

Page 120: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

var AwesomeEffect = function(id, config){ var default = { delay: 0, duration: 500, transition: "easeOut", }; [...]}

var myEff = new AwesomeEffect("myId", { duration: 100, delay: 1000});

//{delay: 1000, duration:100, transition: "easeOut"};

Page 121: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

_.extend(default, config);

Ext.apply(default, config);

$.extend(default, config);

Object.extend(default, config);

Page 122: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

MyNS.extend = function(destination, source) {

}

var AwesomeEffect = function(id, config){ var default = { delay: 0, duration: 500, transition: "easeOut", }; var options = MyNS.extend(default, config); [...]}

$.extend(default, config);

Page 123: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

MyNS.extend = function(destination, source) {

}

var AwesomeEffect = function(id, config){ var default = { delay: 0, duration: 500, transition: "easeOut", }; var options = MyNS.extend(default, config); [...]}

$.extend(default, config);

Page 124: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

MyNS.extend = function(destination, source) {

}

var AwesomeEffect = function(id, config){ var default = { delay: 0, duration: 500, transition: "easeOut", }; var options = MyNS.extend(default, config); [...]}

Ext.apply(default, config);

Page 125: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

MyNS.extend = function(destination, source) {

}

var AwesomeEffect = function(id, config){ var default = { delay: 0, duration: 500, transition: "easeOut", }; var options = MyNS.extend(default, config); [...]}

_.extend(default, config);

Page 126: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

MyNS.extend = function(destination, source) {

}

var AwesomeEffect = function(id, config){ var default = { delay: 0, duration: 500, transition: "easeOut", }; var options = MyNS.extend(default, config); [...]}

Object.extend(default, config);

Page 127: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Wasn’t it bad to delegate?

http://clericalwhispers.blogspot.it/2010/09/popes-anti-condom-message-is-sabotage.html

Page 128: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

MyNS.extend = function(destination, source) {

}

var AwesomeEffect = function(id, config){ var default = { delay: 0, duration: 500, transition: "easeOut", }; var options = MyNS.extend(default, config); [...]}

$.extend(default, config);

Page 129: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

MyNS.Layer = function(content, config){

config = MyNS.extend({ overlayOpacity:0.6, imageLoading: "/img/loader.gif", }, config); new LightBox(content, config);}

Page 130: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

MyNS.Layer = function(content, config){

config = MyNS.extend({ overlayOpacity:0.6, imageLoading: "/img/loader.gif", }, config); new LightBox(content, config);}

Page 131: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

MyNS.Layer = function(content, config){

config = MyNS.extend({ overlayOpacity:0.6, imageLoading: "/img/loader.gif", }, config); new LightBox(content, config);}

Page 132: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

MyNS.Layer = function(content, config){

config = MyNS.extend({ opacity: true, modal: true, }, config); new FancyBox(content, config);}

Page 133: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

MyNS.Layer = function(content, config){

config = MyNS.extend({ opacity: true, modal: true, }, config); new FancyBox(content, config);}

Page 134: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

MyNS.Layer = function(content, config){

config = MyNS.extend({ opacity: true, modal: true, }, config); new FancyBox(content, config);}

Page 135: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Event Driven Design

Page 136: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

MyNS.Layer = function(content, config){ [...]

}

Page 137: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

MyNS.Layer("Sorry, an error occured");

Page 138: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

MyNS.notify("error", {

msg: "Sorry, an error occured"

});

Page 139: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

MyNS.notify("error", {

msg: "Sorry, an error occured"

});

MyNS.listen("error", function(payload){

MyNS.Layer(payload.msg);

});

Page 140: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

MyNS.notify("error", {

msg: "Sorry, an error occured"

});

MyNS.listen("error", function(payload){

MyNS.Layer(payload.msg);

});

Page 141: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

MyNS.notify("error", {

msg: "Sorry, an error occured"

});

MyNS.listen("error", function(payload){

MyNS.Layer(payload.msg);

});

Page 142: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

MyNS.notify("error", {

msg: "Sorry, an error occured"

});

MyNS.listen("error", function(payload){

MyNS.Layer(payload.msg);

});

Page 143: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

MyNS.notify("error", {

msg: "Sorry, an error occured"

});

MyNS.listen("error", function(payload){

MyNS.Layer(payload.msg);

});

Page 144: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

MyNS.notify("error", {

msg: "Sorry, an error occured"

});

MyNS.listen("error", function(payload){

MyNS.Layer(payload.msg);

});

Page 145: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

MyNS.notify("error", {

msg: "Sorry, an error occured"

});

MyNS.listen("error", function(payload){

MyNS.Layer(payload.msg);

});

Page 146: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

MyNS.notify("error", {

msg: "Sorry, an error occured"

});

MyNS.listen("error", function(payload){

MyNS.Layer(payload.msg);

});

Page 147: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

MyNS.listen("error", function(payload){

MyNS.Layer(payload.msg);

});

Advantages

Page 148: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

MyNS.listen("error", function(payload){

MyNS.Layer(payload.msg);

});

Advantages

Semantic

Page 149: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

MyNS.listen("error", function(payload){

MyNS.Layer(payload.msg);

});

Advantages

Semantic

More Flexible

Page 150: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Advantages

Unpluggable

Page 151: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

MyNS.notify("error", {

msg: "Sorry, an error occured"

});

Page 152: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

almost decoupled

http://thewellversed.com/2010/12/09/love-warranties-they-dont-make-them-like-they-used-to/broken-heart/

Page 153: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

What about the dom?

Page 154: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Actually decoupled

http://thewellversed.com/2010/12/09/love-warranties-they-dont-make-them-like-they-used-to/broken-heart/

Page 155: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Ain’t that badhttp://locomente.blogspot.it/2012/02/single-unemployed.html

Page 156: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

LOVE FACT #3

2 out of 5 people marry their first love.

Page 157: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Advantages of this approach

Page 158: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Portability & Maintainability

http://news.tecnozoom.it/tv-lcd/piu-persone-usano-tv-ed-internet-contemporaneamente-post-16157.html - http://marine.rina.org/CATEGORIE_SERVIZI/Gestione_rischio/servizi/maintenance.aspx

Page 160: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

Improve javascript skills

http://edtechdigest.wordpress.com/2010/09/06/6-reasons-why-students-need-21st-century-skills/

Page 161: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

You got me, I will drop my framework

Page 162: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

are you sure?

http://loveallit.tumblr.com/post/1044567068/jegushi-please-dont-leave-me

Page 163: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

it might be the right one

http://loveallit.tumblr.com/post/1044567068/jegushi-please-dont-leave-me

Page 164: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

the whole point is

Page 165: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

BE A JAVASCRIPT PERVERT

Page 166: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

play with javascript

discover your limits

BE A JAVASCRIPT PERVERT

Page 167: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

play with javascript

discover your limits

BE A JAVASCRIPT PERVERT

Page 168: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

play with javascript

discover your limits

BE A JAVASCRIPT PERVERT

get to know microframeworks

Page 169: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

play with javascript

discover your limits

BE A JAVASCRIPT PERVERT

get to know microframeworks

let github be your playground

Page 170: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

play with javascript

discover your limits

BE A JAVASCRIPT PERVERT

get to know microframeworks

let github be your playground

javascript is fun

Page 171: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

play with javascript

discover your limits

BE A JAVASCRIPT PERVERT

get to know microframeworks

let github be your playground

javascript is fun

javascript is lovable

Page 172: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

play with javascript

discover your limits

BE A JAVASCRIPT PERVERT

get to know microframeworks

let github be your playground

javascript is fun

javascript is lovablebut you need to...

Page 173: JsDay - It's not you, It's me (or how to avoid being coupled with a Javascript framework)

know when to stop