Upgrade to Pro — share decks privately, control downloads, hide ads and more …

It's not you, it's me - jsDay

It's not you, it's me - jsDay

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 snippets of code) to avoid being coupled to a specific framework.

Marco Cedaro

May 17, 2012
Tweet

More Decks by Marco Cedaro

Other Decks in Programming

Transcript

  1. About me... Frontend Cowboy Nicola Vitto Jr. Javascript Pervert Roberto

    Felter Hello, who’s speaking? Marco Cedaro @cedmax
  2. About me... Frontend Cowboy Nicola Vitto Jr. Javascript Pervert Roberto

    Felter Marco.. who? basically anyone else Hello, who’s speaking? Marco Cedaro @cedmax
  3. Actually I am: a Frontend Developer at Spreaker.com Conference organizer

    with From The Front Hello, who’s speaking? Marco Cedaro @cedmax
  4. 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
  5. 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.
  6. Now

  7. Why did they get so popular? DOM access Cross browser

    implementation Shorthands Community scripts
  8. 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
  9. Long life cycle websites General purpose framework may seem the

    right solution to handle complexity New browser, new framework version 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
  10. Long life cycle websites General purpose framework may seem the

    right solution to handle complexity New browser, new framework version 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
  11. 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/
  12. 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/
  13. case study Own scripts built on a known framework 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
  14. 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
  15. case study Own scripts built on a known framework Brand

    new website with responsive design same old bloat code over 3g? 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
  16. LOVE FACT #2 What is known as a French Kiss

    in the English speaking world is called an English Kiss in France.
  17. _.each(items, function(item, i) { [...] }); Ext.each(items, function(item, i) {

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

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

    [...] }); $.each(items, function(i, item) { [...] }); items.each(function(item, i) { [...] });
  20. for (var i = 0; i < items.length; i++) {

    [...] }; $.each(items, function(i, item) { [...] });
  21. for (var i = 0; i < items.length; i++) {

    [...] }; $.each(items, function(i, item) { [...] });
  22. for (var i = 0; i < items.length; i++) {

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

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

    }; var len = items.length; for (var i = -1; ++i < len;) { [...] };
  25. MyNS.bind = function(func, context) { return function() { func.apply(context, arguments);

    }; } myElm.onclick = $.proxy(conf.clicked, conf); myElm.onclick = MyNS.bind(conf.clicked, conf);
  26. MyNS.bind = function(func, context) { } myElm.onclick = MyNS.bind(conf.clicked, conf);

    return function() { return func.apply(context, arguments); };
  27. 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"};
  28. 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"};
  29. 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"};
  30. 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"};
  31. 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"};
  32. 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"};
  33. 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);
  34. 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);
  35. 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);
  36. 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);
  37. 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);
  38. 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);
  39. play with javascript discover your limits BE A JAVASCRIPT PERVERT

    get to know microframeworks let github be your playground
  40. play with javascript discover your limits BE A JAVASCRIPT PERVERT

    get to know microframeworks let github be your playground javascript is fun
  41. 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
  42. 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 but you need to...