SlideShare une entreprise Scribd logo
1  sur  85
Télécharger pour lire hors ligne
Seven Reasons
 for Code Bloat




                  WSG London, May 2007
                    Christian Heilmann
• All of the following is licensed
  under a Creative Commons
  Attribution-Share Alike 3.0
  License
  http://creativecommons.org/
  licenses/by-sa/3.0/ which
  means you can re-use it by
  attributing anything you use
  to me.


  Go Nuts!
• First of all: as there has been
  talk that there is not enough
  diversity in speakers on web
  events:
   – I am a foreigner
   – I am a pescetarian
   – I have flat feet
   – I have a sight impairment
   – I am ginger
• There is a new buzzword in
  town: POSH
• Plain Old Semantic HTML
  – It takes a bit of effort to make
    pretty
  – It is very good in communicating
    your content in a clear manner
  – It is glamorous to talk about it
    right now.
• But today we are going to talk
  about BECS instead:
• Bloated Embarrassing Code
  Solutions
  – Fast on their feet
  – Expensive to make work
    somewhere else
  – Obvious communication
    problems
• One of the biggest problems
  of web development right now
  is bloat.
• Bloat manifests itself in
  several forms:
   – Slow web sites
   – Overloaded servers
   – Stretched or missed deadlines
   – Maintenance nightmares




                                     http://www.flickr.com/photos/cliph/394713939/
• I won’t talk about server or
  server side code optimization
• I will not talk much about
  client side code optimization
  either.
• Instead I will talk about the
  reasons for web site bloat.
• We all know how to avoid
  bloated code.
• It has been best practice for
  years and every Java
  developer has a lot to say how
  to optimize your CSS and
  JavaScript
• How come we still have to
  deal with it?
• Reason#1 for bloated code:
• Wrong perception of time
  needed to accustom
  ourselves to a project
• Web developers are gods
• We can be allocated to any
  product, lay our hands on it in
  a Vulcan mind-meld fashion
  and understand immediately
  what is going on.
• No need to plan any time for
  reading up or handover from
  the previous developer.




                                    http://www.flickr.com/photos/redux/174708127
• Reason#2 for bloated code:
• Maintenance without using
  the right tools
• Maintained CSS:


    html body #content   #mainsection li a:link{
      color:#333;
    }
    html body #content   #mainsection li a:visited{
      color:#000;
    }
    html body #content   #mainsection li a:hover{
      color:#999;
    }
    html body #content   #mainsection li a:active{
      color:#999;
    }
• Other solutions:
  – !important for all
  – Adding extra DIVs with IDs.
  – Inline styles or style attributes

• For JavaScript:
  – Add another addEvent
  – Add an inline script
  – Add some inline event handlers
    or javascript: links
• A hero to the rescue
• Reason#2 for bloated code:
• Bad or non-existent
  documentation
• Documentation is a PITA:
  – You need to know the system to
    write it
  – You need to be able to
    communicate the system to
    others in an easy to understand
    manner.
  – This means a lot of time and
    effort.




                                      http://www.flickr.com/photos/yggg/130617194/
• The cheap solution
  – Create the documentation from
    source code comments.
  – That way you don’t need to
    spend extra time on it.
  – You also ensure that only the
    people who originally developed
    the system will be able to
    understand the documentation.




                                      http://www.flickr.com/photos/54177448@N00/347535248/
• A real solution
   – Let your development team
     explain the system to someone
     who can write in a fashion
     comprehensible to humans.
   – By all means have a good
     JavaDoc style API
     documentation.
   – Don’t forget the “cookbook”
     approach though.
   – Don’t bother with “hello world”
     examples, use real
     implementation scenarios
     instead.
                                       http://www.flickr.com/photos/sugarcoma/171016512/
• Reason#3 for bloated code:
• People do not read or look
  before they start
• Sounds harsh?
• First example: a very easy
  binary system in daily use.




                                http://www.flickr.com/photos/eins_aaa_zivi/337910578/
• Or take this example from
  Amazon.
• It is a comment on my book
  “Beginning JavaScript with
  DOM Scripting and Ajax”
I keep running into a custom
object in the code examples of the
book called quot;DOMhelpquot;. (…) For
example, instead of using the
actual DOM methods to get all the
links on the page and loop through
them, he shows you a line of code
that just says quot;DOMhelp.getlinksquot;.
Yes, that line does the same thing
by accessing his object and
running the regular DOM functions,
but what does it teach me?
Nothing. That alone is a big enough
annoyance to regret buying this
book.
                                      http://www.icanhascheezburger.com
• There is no function with that
  name anywhere in the book.
• Chapter 4 introduces the idea
  and rationale of JavaScript
  libraries and takes tool
  methods explained in Chapter
  1 to 3 to assemble
  DOMhelp.js.




                                   http://www.icanhascheezburger.com
• Another example:
  – A supplier of one of my clients
    was to build a small web site
    explaining functionality with
    slide shows.
  – The slide shows were JS
    dependent and my client asked
    me to send them an unobtrusive
    script.
• This is what I did for them:


     popups = {
       // id of the section with the popup links
       popupsContainerId:’main’,
       // id of the login show link
       loginLinkId:’loginshowtrigger’,
       // id of the subscribe show link
       subscribeLinkId:’subscribeshowtrigger’,
       // text of the login slideshow link
       loginLabel:’how to login’,
       // text of the subscribe slideshow link
       subscribeLabel:’how to subscribe’,
• This is what I did for them:


     init:function(){
       var o =
     document.getElementById(popups.popupsContainerId);
       if(o){
         popups.loginLink = document.createElement(‘a’);
         popups.loginLink.setAttribute(‘href’, ‘#’);
         popups.loginLink.appendChild(popups.loginLabel);
         popups.loginLink.id = popups.loginLinkId;
         popups.addEvent(popups.loginLink, ‘click’,
                         popups.loginShow);
         o.appendChild(popups.loginLink);
• This is what I did for them:


         popups.subscribeLink = document.createElement(‘a’);
         popups.subscribeLink.setAttribute(‘href’, ‘#’);

     popups.subscribeLink.appendChild(popups.subscribeLabel);
          popups.subscribeLink.id = popups.subscribeLinkId;
          popups.addEvent(popups.subscribeLink, ‘click’,
                          popups.subscribeShow);
          o.appendChild(popups.subscribeLink);
        }
     },
     loginShow:function(){…},
     subscribeShow:function(){…},
     addEvent:function(){…}
     }
     popups.addEvent(window,’load’,popups.init);
• This is part of the HTML that came back:


     <a href=”javascript:popups.loginShow()”>Show login
     demo</a>
     <a href=”javascript:popups2.subscribeShow()”>Show
     subscribe demo</a>
• This happened to my script:


     popups = {
       […]
       init:function(){
         var o =
     document.getElementById(popups.popupsContainerId);
         if(o){
           […]
           // o.appendChild(popups.loginLink);
           […]
           // o.appendChild(popups.subscribeLink);
         }
       },
       loginShow:function(){…},
       subscribeShow:function(){…},
       addEvent:function(){…}
     }
• This happened to my script:


     popups2 = {
       […]
       init:function(){
         var o =
     document.getElementById(popups.popupsContainerId);
         if(o){
           […]
           // o.appendChild(popups.loginLink);
           […]
           // o.appendChild(popups.subscribeLink);
         }
       },
       loginShow:function(){…},
       subscribeShow:function(){…},
       addEvent:function(){…}
     }
     popups.addEvent(window,’load’,popups.init);
     popups2.addEvent(window,’load’,popups2.init);
• Now, all of this could be
  explained with a pretty easy
  equation.




     People = Morons
• However, I think the problem
  lies deeper.
• There is a natural instinct in
  people to solve issues their
  way first and then listen to
  reason or trust in any
  information.
• Take this behaviour example:
• Man buys a ridiculously
  expensive technical gadget
  that needs assembling
• Man looks at wonderfully
  designed and written manual
• Man puts manual aside
• Man starts assembling the
  gadget to the best of his
  knowledge
• If things don’t fit – more
  pressure will do the trick.
• Assembled product doesn’t
  work
• Man shakes the product or
  knocks on its side or top
• Man goes back to shop or
  picks up the phone and
  complain to the manufacturer
  that their product is too hard
  to assemble or doesn’t work
• Clever companies discovered
  that pattern and style their
  products accordingly.
• Cryptic iconography
• Hard to pronounce names
• Not enough or too many
  assembly parts (pot luck)


       Assembly !== Chore

       Assembly === Adventure

                                 http://flickr.com/photos/powerbooktrance/114531319/
• Heilmann’s law of
  documentation:
• Heilmann’s law of
  documentation:
  Your documentation is only as
  good as the worst recipient.
• First follow-up fact:
• First follow-up fact:
  The worst recipient is the only
  person that will contact you
  about your documentation.
• Second follow-up fact:
• Second follow-up fact:
  This is also the only person
  that will write about your
  product elsewhere.
• Reason#5 for bloated code:
• Lack of awareness
• A lot of times people don’t
  bother understanding the
  impact of something they use
  before they use it.
• You see web sites that have
  prototype, scriptaculous (add
  the dots yourself), jQuery and
  YUI included as there was a
  cool demo somewhere they
  wanted to use.
• With YUI you also see the
  wrong versions in use. Each
  YUI component comes in
  three flavours:
  – The minified version (no
    comment, no whitespace)
  – The normal version (for easy
    readability)
  – The debug version (with lots of
    comments being sent to
    console or logger)
• A big problem is that scripting
  is considered as a given.
• It is not. JavaScript can and
  will be disabled for some
  users.
• This is the test case that
  should be tried out from time
  to time.
• Make sure that those users
  don’t get overwhelmed with
  too many options and content
  on a single page.
• If necessary, you can load the
  extra content with Ajax after
  the page has loaded.
• This will also make the initial
  loading and rendering a lot
  faster.
• As this easy testing step is
  not taken we have bloated
  web sites.
• The same phenomenon shows
  itself when people learnt the
  syntax of a technology
  (w3schools.com anyone?) and
  apply this little knowledge all
  over the shop.
• I am sure you have seen constructs like this:


     <ul>
       <li   class=”list-item”>The Passenger</li>
       <li   class=”list-item currentlyplaying”>Louie Louie</li>
       <li   class=”list-item”>I want to conquer the world</li>
       <li   class=”list-item”>Foxtrott Uniform Charlie Kilo</li>
     </ul>

     li.list-item{ padding:.5em; font-
     family:courier;color:#000; }
     li.currentlyplaying{ color:#c00; }
CSS for the logically challenged
• Start with a global whitespace reset


     *{
          margin:0;
          padding:0;
          list-style:none;
          border:none;
     }
• Now define the most common elements you use and
  give them a predefined style:

    body{
      font-family:helvetica,arial,sans-serif;
      background:#fff;
      color:#333;
      padding:2em;
    }
    p,li {
      padding-bottom:.5em;
      line-height:1.3em;
    }
    h1,h2,h3,h4,h5,h6{
      padding-bottom:.5em;
    }
• Then override or extend these settings with special
  cases inside elements with IDs:

     #playlist li{
       padding:1em .5em;
     }
     #header p{
       border:1px solid #999;
       background:#ddd;
     }

     <ul id=”playlist”>
       <li>The Passenger</li>
       <li>Louie Louie</li>
       <li>I want to conquer the world</li>
       <li>Foxtrott Uniform Charlie Kilo</li>
     </ul>
• Then you can detect the exceptions to the rule that
  need extra formatting. For these use CSS classes.

     #playlist li{ padding:.5em; font-
     family:courier;color:#000; }
     #playlist li.currentlyplaying { color:#c00; }

     <ul id=”playlist”>
       <li>The Passenger</li>
       <li class=”currentlyplaying”>Louie Louie</li>
       <li>I want to conquer the world</li>
       <li>Foxtrott Uniform Charlie Kilo</li>
     </ul>
• The best thing about
  Cascading Style Sheets is
  that they do cascade.
• Instead of re-define, try to re-
  use and extend.
• Reason#6 for bloated code:
• Failure to specialize
• This is a tricky one.
• Code bloat happens when you
  try to make your code do
  everything that is even
  remotely possible instead of
  allowing it to do one thing
  right.
• Edge cases become more
  important than covering the
  basics.
• The reason is that you want to
  meet expectations.
  – A script that only does one thing
    and that thing really well is
    great to use.
  – A script that does one thing,
    offers fancy options and is as
    generic as possible to be re-
    used over and over again is
    more appreciated.
• This becomes most apparent
  in JavaScript libraries.
• To me, a JS library needs to do
  one thing:
• Make browser and language
  behaviour less random.
• If it does that, I am happy as I
  do know how to write
  JavaScript.
• The most acclaimed libraries
  do more though:
  – Extend the language with a new
    syntax – chainable methods for
    example
  – Allow access to the document in
    various ways: CSS selector,
    Xpath, background color (not
    yet, but who knows)
• The rationale: easier
  development by avoiding
  verbose DOM methods.
• However – HTML is the thing
  that is most likely to change
  at any time.
• With DOM methods I can test
  every step on the way and
  know when something fails.
• The other snag: compatibility
  of libraries.
• Both method names and
  parameter order vary.
• Not a problem, when you stick
  to one library.
• Agencies however are likely
  to change technology from
  project to project.
• We already had that:
  – Intershop
  – Intershop Infinity
  – Tridion
  – Immediacy
  – Vignette
  – Documentum
  – Focus Goal Builder
  – Mambo / Joomla
  – Typo3
• If I want to hire a good web
  developer right now, I ask for the
  following:
   – HTML / Semantics
   – CSS
   – JavaScript / DOM
   – PHP
                                          Talk to me later!
   – London based or willing to commute
   – Always eager to improve.
• However, if I were still
  working in an agency, this
  might be:
  – JavaScript
  – jQuery
  – Dojo
  – Apollo
  – Prototype
  – Mootools
  – Atlas
  – Google Web Kit
  – HTML, CSS
• Another type of bloat is bad
  implementation of scripts.
• Maybe some scripts should be
  more restrictive.
• Does a multi level dropdown
  script or an image slideshow
  with transition effects really
  need to be possible several
  times in the same page?
• JavaScript is there to help
  aiding the users, not to
  overwhelm them.
• If you allow bad implementers
  to easily create a bloated
  interface you don’t follow that
  principle.
• This may sound arrogant, but
  I’d rather have my scripts not
  used than to have them used
  to create inaccessible web
  sites.
• Instead of trying to create
  “one size fits all” solutions we
  could create the following:
   – Do one job right
   – Be extendable
   – Offer extension modules.
• Reason#7 for bloated code:
• Lack of a front-end build
  process
• Web Developers don’t get any
  Kudos.
• There is a code freeze phase
  with a kill date on backend
  code.
• There are build scripts that
  convert maintained code into
  live code.
• The frontend however is for
  everyone to change.
• HTML, CSS and JavaScript are
  not really programming skills.
• Therefore anyone can be
  parachuted in to use Vi (or
  Emacs) on the live server to
  add a FONT here and a
  CENTER there.
• It is tricky to get out of this,
  as it needs a shift in the
  perception of the job of a web
  developer.
• The IWA/HWG together with
  the W3C is working on a web
  developer certification which
  can make us a larger blip on
  the radar of business.
• However, right now there is a
  sneakier way:
• Minify the heck out of your
  code before it goes live.
• Concatenate all scripts into
  one include.
• Concatenate all CSS into one
  include
• There is a script for this
  available on
  http://www.ejeliot.com
• Add a comment above the
  document stating that this
  was built and is not code to
  be edited.
• Use CSS sprites to use only a
  few images on the whole
  page.
  – Your pages will load and render
    faster (less HTTP requests).

• For added fun, add scary
  comments.
• Examples of good comments to throw off non-web
  developers:

    <!-- built on 12.03.07 12.33 GMT Checksum E5322AE - OK,
    build continues -->
    <!-- built on 14.03.07 08.00 Checksum error!- build
    failed, sent notification mail -->
    <!-- built on 14.03.07 08.10 Checksum E5322F3 – fix
    initiated and successful -->
    <!-- verified fix mstephens 14.03.07 09.00 -->

    (mstephens should be someone in upper management)
• Examples of good comments to throw off non-web
  developers:

    /* Internet Explorer hack to prevent colour bleed and sync
    loss*/

    /* do not change order or Firefox will go into
    hasWrongRender mode */

    <!-- Whitespace HTML rendering mode on, do not change! -->

    /* Last change stopped Google indexing this, please don’t
    change anything! */
• Last but not least, see you at
  Open Hack Day
  on 16th of June in Alexandra
  Palace.
• Sign up at
  http://www.hackday.org
THANKS!


rel = “me”




chris.heilmann@gmail.com
http://wait-till-i.com
http://icant.co.uk

Contenu connexe

Tendances

Ajax to the Moon
Ajax to the MoonAjax to the Moon
Ajax to the Moondavejohnson
 
Behat - Drupal South 2018
Behat  - Drupal South 2018Behat  - Drupal South 2018
Behat - Drupal South 2018Berend de Boer
 
Don't make me wait! or Building High-Performance Web Applications
Don't make me wait! or Building High-Performance Web ApplicationsDon't make me wait! or Building High-Performance Web Applications
Don't make me wait! or Building High-Performance Web ApplicationsStoyan Stefanov
 
Mozilla Firefox Extension Development, Course 1: Basic
Mozilla Firefox Extension Development, Course 1: BasicMozilla Firefox Extension Development, Course 1: Basic
Mozilla Firefox Extension Development, Course 1: Basiclittlebtc
 
Deliverance: Plone theming without the learning curve from Plone Symposium Ea...
Deliverance: Plone theming without the learning curve from Plone Symposium Ea...Deliverance: Plone theming without the learning curve from Plone Symposium Ea...
Deliverance: Plone theming without the learning curve from Plone Symposium Ea...Jazkarta, Inc.
 
Enterprise PHP Development - ZendCon 2008
Enterprise PHP Development - ZendCon 2008Enterprise PHP Development - ZendCon 2008
Enterprise PHP Development - ZendCon 2008Ivo Jansch
 
API Technical Writing
API Technical WritingAPI Technical Writing
API Technical WritingSarah Maddox
 
Unobtrusive JavaScript
Unobtrusive JavaScriptUnobtrusive JavaScript
Unobtrusive JavaScriptdaveverwer
 
The Structure of Web Code: A Case For Polymer, November 1, 2014
The Structure of Web Code: A Case For Polymer, November 1, 2014The Structure of Web Code: A Case For Polymer, November 1, 2014
The Structure of Web Code: A Case For Polymer, November 1, 2014Tommie Gannert
 
You too can be a bedwetting antfucker: Bruce Lawson, Opera, Fronteers 2011
You too can be a bedwetting antfucker: Bruce Lawson, Opera, Fronteers 2011You too can be a bedwetting antfucker: Bruce Lawson, Opera, Fronteers 2011
You too can be a bedwetting antfucker: Bruce Lawson, Opera, Fronteers 2011brucelawson
 
Migrating existing monolith to serverless in 8 steps
Migrating existing monolith to serverless in 8 stepsMigrating existing monolith to serverless in 8 steps
Migrating existing monolith to serverless in 8 stepsYan Cui
 
Passo a Passo para criar uma aplicação Móvel Híbrida
Passo a Passo para criar uma aplicação Móvel HíbridaPasso a Passo para criar uma aplicação Móvel Híbrida
Passo a Passo para criar uma aplicação Móvel HíbridaJuliano Martins
 
Essential open source tools for serverless developers
Essential open source tools for serverless developersEssential open source tools for serverless developers
Essential open source tools for serverless developersYan Cui
 
HTML5 and Accessibility sitting in a tree
HTML5 and Accessibility sitting in a treeHTML5 and Accessibility sitting in a tree
HTML5 and Accessibility sitting in a treebrucelawson
 
HTML5 Who what where when why how
HTML5 Who what where when why howHTML5 Who what where when why how
HTML5 Who what where when why howbrucelawson
 
Web Unleashed '19 - Measuring the Adoption of Web Performance Techniques
Web Unleashed '19 - Measuring the Adoption of Web Performance TechniquesWeb Unleashed '19 - Measuring the Adoption of Web Performance Techniques
Web Unleashed '19 - Measuring the Adoption of Web Performance TechniquesPaul Calvano
 

Tendances (20)

Ajax to the Moon
Ajax to the MoonAjax to the Moon
Ajax to the Moon
 
Behat - Drupal South 2018
Behat  - Drupal South 2018Behat  - Drupal South 2018
Behat - Drupal South 2018
 
Don't make me wait! or Building High-Performance Web Applications
Don't make me wait! or Building High-Performance Web ApplicationsDon't make me wait! or Building High-Performance Web Applications
Don't make me wait! or Building High-Performance Web Applications
 
Fast by Default
Fast by DefaultFast by Default
Fast by Default
 
Mozilla Firefox Extension Development, Course 1: Basic
Mozilla Firefox Extension Development, Course 1: BasicMozilla Firefox Extension Development, Course 1: Basic
Mozilla Firefox Extension Development, Course 1: Basic
 
WPDay Bologna 2013
WPDay Bologna 2013WPDay Bologna 2013
WPDay Bologna 2013
 
Deliverance: Plone theming without the learning curve from Plone Symposium Ea...
Deliverance: Plone theming without the learning curve from Plone Symposium Ea...Deliverance: Plone theming without the learning curve from Plone Symposium Ea...
Deliverance: Plone theming without the learning curve from Plone Symposium Ea...
 
Enterprise PHP Development - ZendCon 2008
Enterprise PHP Development - ZendCon 2008Enterprise PHP Development - ZendCon 2008
Enterprise PHP Development - ZendCon 2008
 
Progressive Enhancement
Progressive EnhancementProgressive Enhancement
Progressive Enhancement
 
API Technical Writing
API Technical WritingAPI Technical Writing
API Technical Writing
 
Unobtrusive JavaScript
Unobtrusive JavaScriptUnobtrusive JavaScript
Unobtrusive JavaScript
 
The Structure of Web Code: A Case For Polymer, November 1, 2014
The Structure of Web Code: A Case For Polymer, November 1, 2014The Structure of Web Code: A Case For Polymer, November 1, 2014
The Structure of Web Code: A Case For Polymer, November 1, 2014
 
You too can be a bedwetting antfucker: Bruce Lawson, Opera, Fronteers 2011
You too can be a bedwetting antfucker: Bruce Lawson, Opera, Fronteers 2011You too can be a bedwetting antfucker: Bruce Lawson, Opera, Fronteers 2011
You too can be a bedwetting antfucker: Bruce Lawson, Opera, Fronteers 2011
 
Migrating existing monolith to serverless in 8 steps
Migrating existing monolith to serverless in 8 stepsMigrating existing monolith to serverless in 8 steps
Migrating existing monolith to serverless in 8 steps
 
Passo a Passo para criar uma aplicação Móvel Híbrida
Passo a Passo para criar uma aplicação Móvel HíbridaPasso a Passo para criar uma aplicação Móvel Híbrida
Passo a Passo para criar uma aplicação Móvel Híbrida
 
Essential open source tools for serverless developers
Essential open source tools for serverless developersEssential open source tools for serverless developers
Essential open source tools for serverless developers
 
HTML5 and Accessibility sitting in a tree
HTML5 and Accessibility sitting in a treeHTML5 and Accessibility sitting in a tree
HTML5 and Accessibility sitting in a tree
 
HTML5 Who what where when why how
HTML5 Who what where when why howHTML5 Who what where when why how
HTML5 Who what where when why how
 
How cgi scripting works
How cgi scripting worksHow cgi scripting works
How cgi scripting works
 
Web Unleashed '19 - Measuring the Adoption of Web Performance Techniques
Web Unleashed '19 - Measuring the Adoption of Web Performance TechniquesWeb Unleashed '19 - Measuring the Adoption of Web Performance Techniques
Web Unleashed '19 - Measuring the Adoption of Web Performance Techniques
 

Similaire à Seven Reasons for Code Bloat

Progressive Enhancement with JavaScript and Ajax
Progressive Enhancement with JavaScript and AjaxProgressive Enhancement with JavaScript and Ajax
Progressive Enhancement with JavaScript and AjaxChristian Heilmann
 
Intro To Django
Intro To DjangoIntro To Django
Intro To DjangoUdi Bauman
 
Progressive web and the problem of JavaScript
Progressive web and the problem of JavaScriptProgressive web and the problem of JavaScript
Progressive web and the problem of JavaScriptChristian Heilmann
 
Resisting The Feature Creature
Resisting The Feature CreatureResisting The Feature Creature
Resisting The Feature CreatureChristian Heilmann
 
Intro to Php Security
Intro to Php SecurityIntro to Php Security
Intro to Php SecurityDave Ross
 
Leveling up your JavaScipt - DrupalJam 2017
Leveling up your JavaScipt - DrupalJam 2017Leveling up your JavaScipt - DrupalJam 2017
Leveling up your JavaScipt - DrupalJam 2017Christian Heilmann
 
Jazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
Jazz up your JavaScript: Unobtrusive scripting with JavaScript librariesJazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
Jazz up your JavaScript: Unobtrusive scripting with JavaScript librariesSimon Willison
 
2012 03 27_philly_jug_rewrite_static
2012 03 27_philly_jug_rewrite_static2012 03 27_philly_jug_rewrite_static
2012 03 27_philly_jug_rewrite_staticLincoln III
 
Ruby on Rails - The Best Track for your Start Up
Ruby on Rails - The Best Track for your Start UpRuby on Rails - The Best Track for your Start Up
Ruby on Rails - The Best Track for your Start UpPrateek Saxena
 
Web2.0: from "I know nothing" to "I know something" in 2 hours (what?!?)
Web2.0: from "I know nothing" to "I know something" in 2 hours (what?!?)Web2.0: from "I know nothing" to "I know something" in 2 hours (what?!?)
Web2.0: from "I know nothing" to "I know something" in 2 hours (what?!?)Paolo Massa
 
4007655 introduction-to-javascript
4007655 introduction-to-javascript4007655 introduction-to-javascript
4007655 introduction-to-javascriptVikash Chandra
 
GDD Japan 2009 - Designing OpenSocial Apps For Speed and Scale
GDD Japan 2009 - Designing OpenSocial Apps For Speed and ScaleGDD Japan 2009 - Designing OpenSocial Apps For Speed and Scale
GDD Japan 2009 - Designing OpenSocial Apps For Speed and ScalePatrick Chanezon
 
Streamlining Your Applications with Web Frameworks
Streamlining Your Applications with Web FrameworksStreamlining Your Applications with Web Frameworks
Streamlining Your Applications with Web Frameworksguestf7bc30
 
Fix me if you can - DrupalCon prague
Fix me if you can - DrupalCon pragueFix me if you can - DrupalCon prague
Fix me if you can - DrupalCon praguehernanibf
 
Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010
Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010
Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010singingfish
 
Progressive Web App Challenges
Progressive Web App ChallengesProgressive Web App Challenges
Progressive Web App ChallengesJason Grigsby
 
CICONF 2012 - Don't Make Me Read Your Mind
CICONF 2012 - Don't Make Me Read Your MindCICONF 2012 - Don't Make Me Read Your Mind
CICONF 2012 - Don't Make Me Read Your Mindciconf
 

Similaire à Seven Reasons for Code Bloat (20)

Progressive Enhancement with JavaScript and Ajax
Progressive Enhancement with JavaScript and AjaxProgressive Enhancement with JavaScript and Ajax
Progressive Enhancement with JavaScript and Ajax
 
Intro To Django
Intro To DjangoIntro To Django
Intro To Django
 
Progressive web and the problem of JavaScript
Progressive web and the problem of JavaScriptProgressive web and the problem of JavaScript
Progressive web and the problem of JavaScript
 
Resisting The Feature Creature
Resisting The Feature CreatureResisting The Feature Creature
Resisting The Feature Creature
 
Intro to Php Security
Intro to Php SecurityIntro to Php Security
Intro to Php Security
 
JavaScript isn't evil.
JavaScript isn't evil.JavaScript isn't evil.
JavaScript isn't evil.
 
Leveling up your JavaScipt - DrupalJam 2017
Leveling up your JavaScipt - DrupalJam 2017Leveling up your JavaScipt - DrupalJam 2017
Leveling up your JavaScipt - DrupalJam 2017
 
Jazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
Jazz up your JavaScript: Unobtrusive scripting with JavaScript librariesJazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
Jazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
 
2012 03 27_philly_jug_rewrite_static
2012 03 27_philly_jug_rewrite_static2012 03 27_philly_jug_rewrite_static
2012 03 27_philly_jug_rewrite_static
 
Ruby on Rails - The Best Track for your Start Up
Ruby on Rails - The Best Track for your Start UpRuby on Rails - The Best Track for your Start Up
Ruby on Rails - The Best Track for your Start Up
 
Web2.0: from "I know nothing" to "I know something" in 2 hours (what?!?)
Web2.0: from "I know nothing" to "I know something" in 2 hours (what?!?)Web2.0: from "I know nothing" to "I know something" in 2 hours (what?!?)
Web2.0: from "I know nothing" to "I know something" in 2 hours (what?!?)
 
Shifting Gears
Shifting GearsShifting Gears
Shifting Gears
 
4007655 introduction-to-javascript
4007655 introduction-to-javascript4007655 introduction-to-javascript
4007655 introduction-to-javascript
 
GDD Japan 2009 - Designing OpenSocial Apps For Speed and Scale
GDD Japan 2009 - Designing OpenSocial Apps For Speed and ScaleGDD Japan 2009 - Designing OpenSocial Apps For Speed and Scale
GDD Japan 2009 - Designing OpenSocial Apps For Speed and Scale
 
SearchMonkey
SearchMonkeySearchMonkey
SearchMonkey
 
Streamlining Your Applications with Web Frameworks
Streamlining Your Applications with Web FrameworksStreamlining Your Applications with Web Frameworks
Streamlining Your Applications with Web Frameworks
 
Fix me if you can - DrupalCon prague
Fix me if you can - DrupalCon pragueFix me if you can - DrupalCon prague
Fix me if you can - DrupalCon prague
 
Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010
Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010
Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010
 
Progressive Web App Challenges
Progressive Web App ChallengesProgressive Web App Challenges
Progressive Web App Challenges
 
CICONF 2012 - Don't Make Me Read Your Mind
CICONF 2012 - Don't Make Me Read Your MindCICONF 2012 - Don't Make Me Read Your Mind
CICONF 2012 - Don't Make Me Read Your Mind
 

Plus de Christian Heilmann

Develop, Debug, Learn? - Dotjs2019
Develop, Debug, Learn? - Dotjs2019Develop, Debug, Learn? - Dotjs2019
Develop, Debug, Learn? - Dotjs2019Christian Heilmann
 
Taking the "vile" out of privilege
Taking the "vile" out of privilegeTaking the "vile" out of privilege
Taking the "vile" out of privilegeChristian Heilmann
 
Seven ways to be a happier JavaScript developer - NDC Oslo
Seven ways to be a happier JavaScript developer - NDC OsloSeven ways to be a happier JavaScript developer - NDC Oslo
Seven ways to be a happier JavaScript developer - NDC OsloChristian Heilmann
 
Artificial intelligence for humans… #AIDC2018 keynote
Artificial intelligence for humans… #AIDC2018 keynoteArtificial intelligence for humans… #AIDC2018 keynote
Artificial intelligence for humans… #AIDC2018 keynoteChristian Heilmann
 
Killing the golden calf of coding - We are Developers keynote
Killing the golden calf of coding - We are Developers keynoteKilling the golden calf of coding - We are Developers keynote
Killing the golden calf of coding - We are Developers keynoteChristian Heilmann
 
Progressive Web Apps - Techdays Finland
Progressive Web Apps - Techdays FinlandProgressive Web Apps - Techdays Finland
Progressive Web Apps - Techdays FinlandChristian Heilmann
 
Taking the "vile" out of privilege
Taking the "vile" out of privilegeTaking the "vile" out of privilege
Taking the "vile" out of privilegeChristian Heilmann
 
Five ways to be a happier JavaScript developer
Five ways to be a happier JavaScript developerFive ways to be a happier JavaScript developer
Five ways to be a happier JavaScript developerChristian Heilmann
 
Sacrificing the golden calf of "coding"
Sacrificing the golden calf of "coding"Sacrificing the golden calf of "coding"
Sacrificing the golden calf of "coding"Christian Heilmann
 
You learned JavaScript - now what?
You learned JavaScript - now what?You learned JavaScript - now what?
You learned JavaScript - now what?Christian Heilmann
 
Sacrificing the golden calf of "coding"
Sacrificing the golden calf of "coding"Sacrificing the golden calf of "coding"
Sacrificing the golden calf of "coding"Christian Heilmann
 
Progressive Web Apps - Covering the best of both worlds - DevReach
Progressive Web Apps - Covering the best of both worlds - DevReachProgressive Web Apps - Covering the best of both worlds - DevReach
Progressive Web Apps - Covering the best of both worlds - DevReachChristian Heilmann
 
Progressive Web Apps - Covering the best of both worlds
Progressive Web Apps - Covering the best of both worldsProgressive Web Apps - Covering the best of both worlds
Progressive Web Apps - Covering the best of both worldsChristian Heilmann
 
Non-trivial pursuits: Learning machines and forgetful humans
Non-trivial pursuits: Learning machines and forgetful humansNon-trivial pursuits: Learning machines and forgetful humans
Non-trivial pursuits: Learning machines and forgetful humansChristian Heilmann
 
Progressive Web Apps - Bringing the web front and center
Progressive Web Apps - Bringing the web front and center Progressive Web Apps - Bringing the web front and center
Progressive Web Apps - Bringing the web front and center Christian Heilmann
 
CSS vs. JavaScript - Trust vs. Control
CSS vs. JavaScript - Trust vs. ControlCSS vs. JavaScript - Trust vs. Control
CSS vs. JavaScript - Trust vs. ControlChristian Heilmann
 
The Soul in The Machine - Developing for Humans (FrankenJS edition)
The Soul in The Machine - Developing for Humans (FrankenJS edition)The Soul in The Machine - Developing for Humans (FrankenJS edition)
The Soul in The Machine - Developing for Humans (FrankenJS edition)Christian Heilmann
 
Breaking out of the Tetris mind set #btconf
Breaking out of the Tetris mind set #btconfBreaking out of the Tetris mind set #btconf
Breaking out of the Tetris mind set #btconfChristian Heilmann
 

Plus de Christian Heilmann (20)

Develop, Debug, Learn? - Dotjs2019
Develop, Debug, Learn? - Dotjs2019Develop, Debug, Learn? - Dotjs2019
Develop, Debug, Learn? - Dotjs2019
 
Hinting at a better web
Hinting at a better webHinting at a better web
Hinting at a better web
 
Taking the "vile" out of privilege
Taking the "vile" out of privilegeTaking the "vile" out of privilege
Taking the "vile" out of privilege
 
Seven ways to be a happier JavaScript developer - NDC Oslo
Seven ways to be a happier JavaScript developer - NDC OsloSeven ways to be a happier JavaScript developer - NDC Oslo
Seven ways to be a happier JavaScript developer - NDC Oslo
 
Artificial intelligence for humans… #AIDC2018 keynote
Artificial intelligence for humans… #AIDC2018 keynoteArtificial intelligence for humans… #AIDC2018 keynote
Artificial intelligence for humans… #AIDC2018 keynote
 
Killing the golden calf of coding - We are Developers keynote
Killing the golden calf of coding - We are Developers keynoteKilling the golden calf of coding - We are Developers keynote
Killing the golden calf of coding - We are Developers keynote
 
Progressive Web Apps - Techdays Finland
Progressive Web Apps - Techdays FinlandProgressive Web Apps - Techdays Finland
Progressive Web Apps - Techdays Finland
 
Taking the "vile" out of privilege
Taking the "vile" out of privilegeTaking the "vile" out of privilege
Taking the "vile" out of privilege
 
Five ways to be a happier JavaScript developer
Five ways to be a happier JavaScript developerFive ways to be a happier JavaScript developer
Five ways to be a happier JavaScript developer
 
Taking the P out of PWA
Taking the P out of PWATaking the P out of PWA
Taking the P out of PWA
 
Sacrificing the golden calf of "coding"
Sacrificing the golden calf of "coding"Sacrificing the golden calf of "coding"
Sacrificing the golden calf of "coding"
 
You learned JavaScript - now what?
You learned JavaScript - now what?You learned JavaScript - now what?
You learned JavaScript - now what?
 
Sacrificing the golden calf of "coding"
Sacrificing the golden calf of "coding"Sacrificing the golden calf of "coding"
Sacrificing the golden calf of "coding"
 
Progressive Web Apps - Covering the best of both worlds - DevReach
Progressive Web Apps - Covering the best of both worlds - DevReachProgressive Web Apps - Covering the best of both worlds - DevReach
Progressive Web Apps - Covering the best of both worlds - DevReach
 
Progressive Web Apps - Covering the best of both worlds
Progressive Web Apps - Covering the best of both worldsProgressive Web Apps - Covering the best of both worlds
Progressive Web Apps - Covering the best of both worlds
 
Non-trivial pursuits: Learning machines and forgetful humans
Non-trivial pursuits: Learning machines and forgetful humansNon-trivial pursuits: Learning machines and forgetful humans
Non-trivial pursuits: Learning machines and forgetful humans
 
Progressive Web Apps - Bringing the web front and center
Progressive Web Apps - Bringing the web front and center Progressive Web Apps - Bringing the web front and center
Progressive Web Apps - Bringing the web front and center
 
CSS vs. JavaScript - Trust vs. Control
CSS vs. JavaScript - Trust vs. ControlCSS vs. JavaScript - Trust vs. Control
CSS vs. JavaScript - Trust vs. Control
 
The Soul in The Machine - Developing for Humans (FrankenJS edition)
The Soul in The Machine - Developing for Humans (FrankenJS edition)The Soul in The Machine - Developing for Humans (FrankenJS edition)
The Soul in The Machine - Developing for Humans (FrankenJS edition)
 
Breaking out of the Tetris mind set #btconf
Breaking out of the Tetris mind set #btconfBreaking out of the Tetris mind set #btconf
Breaking out of the Tetris mind set #btconf
 

Dernier

BPPG response - Options for Defined Benefit schemes - 19Apr24.pdf
BPPG response - Options for Defined Benefit schemes - 19Apr24.pdfBPPG response - Options for Defined Benefit schemes - 19Apr24.pdf
BPPG response - Options for Defined Benefit schemes - 19Apr24.pdfHenry Tapper
 
Vp Girls near me Delhi Call Now or WhatsApp
Vp Girls near me Delhi Call Now or WhatsAppVp Girls near me Delhi Call Now or WhatsApp
Vp Girls near me Delhi Call Now or WhatsAppmiss dipika
 
2024 Q1 Crypto Industry Report | CoinGecko
2024 Q1 Crypto Industry Report | CoinGecko2024 Q1 Crypto Industry Report | CoinGecko
2024 Q1 Crypto Industry Report | CoinGeckoCoinGecko
 
The Core Functions of the Bangko Sentral ng Pilipinas
The Core Functions of the Bangko Sentral ng PilipinasThe Core Functions of the Bangko Sentral ng Pilipinas
The Core Functions of the Bangko Sentral ng PilipinasCherylouCamus
 
《加拿大本地办假证-寻找办理Dalhousie毕业证和达尔豪斯大学毕业证书的中介代理》
《加拿大本地办假证-寻找办理Dalhousie毕业证和达尔豪斯大学毕业证书的中介代理》《加拿大本地办假证-寻找办理Dalhousie毕业证和达尔豪斯大学毕业证书的中介代理》
《加拿大本地办假证-寻找办理Dalhousie毕业证和达尔豪斯大学毕业证书的中介代理》rnrncn29
 
(中央兰开夏大学毕业证学位证成绩单-案例)
(中央兰开夏大学毕业证学位证成绩单-案例)(中央兰开夏大学毕业证学位证成绩单-案例)
(中央兰开夏大学毕业证学位证成绩单-案例)twfkn8xj
 
Economics, Commerce and Trade Management: An International Journal (ECTIJ)
Economics, Commerce and Trade Management: An International Journal (ECTIJ)Economics, Commerce and Trade Management: An International Journal (ECTIJ)
Economics, Commerce and Trade Management: An International Journal (ECTIJ)ECTIJ
 
NO1 WorldWide Love marriage specialist baba ji Amil Baba Kala ilam powerful v...
NO1 WorldWide Love marriage specialist baba ji Amil Baba Kala ilam powerful v...NO1 WorldWide Love marriage specialist baba ji Amil Baba Kala ilam powerful v...
NO1 WorldWide Love marriage specialist baba ji Amil Baba Kala ilam powerful v...Amil baba
 
原版1:1复刻堪萨斯大学毕业证KU毕业证留信学历认证
原版1:1复刻堪萨斯大学毕业证KU毕业证留信学历认证原版1:1复刻堪萨斯大学毕业证KU毕业证留信学历认证
原版1:1复刻堪萨斯大学毕业证KU毕业证留信学历认证jdkhjh
 
Stock Market Brief Deck for "this does not happen often".pdf
Stock Market Brief Deck for "this does not happen often".pdfStock Market Brief Deck for "this does not happen often".pdf
Stock Market Brief Deck for "this does not happen often".pdfMichael Silva
 
NO1 WorldWide Genuine vashikaran specialist Vashikaran baba near Lahore Vashi...
NO1 WorldWide Genuine vashikaran specialist Vashikaran baba near Lahore Vashi...NO1 WorldWide Genuine vashikaran specialist Vashikaran baba near Lahore Vashi...
NO1 WorldWide Genuine vashikaran specialist Vashikaran baba near Lahore Vashi...Amil baba
 
NO1 WorldWide online istikhara for love marriage vashikaran specialist love p...
NO1 WorldWide online istikhara for love marriage vashikaran specialist love p...NO1 WorldWide online istikhara for love marriage vashikaran specialist love p...
NO1 WorldWide online istikhara for love marriage vashikaran specialist love p...Amil Baba Dawood bangali
 
Financial Leverage Definition, Advantages, and Disadvantages
Financial Leverage Definition, Advantages, and DisadvantagesFinancial Leverage Definition, Advantages, and Disadvantages
Financial Leverage Definition, Advantages, and Disadvantagesjayjaymabutot13
 
SBP-Market-Operations and market managment
SBP-Market-Operations and market managmentSBP-Market-Operations and market managment
SBP-Market-Operations and market managmentfactical
 
Economic Risk Factor Update: April 2024 [SlideShare]
Economic Risk Factor Update: April 2024 [SlideShare]Economic Risk Factor Update: April 2024 [SlideShare]
Economic Risk Factor Update: April 2024 [SlideShare]Commonwealth
 
The AES Investment Code - the go-to counsel for the most well-informed, wise...
The AES Investment Code -  the go-to counsel for the most well-informed, wise...The AES Investment Code -  the go-to counsel for the most well-informed, wise...
The AES Investment Code - the go-to counsel for the most well-informed, wise...AES International
 
PMFBY , Pradhan Mantri Fasal bima yojna
PMFBY , Pradhan Mantri  Fasal bima yojnaPMFBY , Pradhan Mantri  Fasal bima yojna
PMFBY , Pradhan Mantri Fasal bima yojnaDharmendra Kumar
 
AfRESFullPaper22018EmpiricalPerformanceofRealEstateInvestmentTrustsandShareho...
AfRESFullPaper22018EmpiricalPerformanceofRealEstateInvestmentTrustsandShareho...AfRESFullPaper22018EmpiricalPerformanceofRealEstateInvestmentTrustsandShareho...
AfRESFullPaper22018EmpiricalPerformanceofRealEstateInvestmentTrustsandShareho...yordanosyohannes2
 
Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...
Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...
Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...First NO1 World Amil baba in Faisalabad
 

Dernier (20)

BPPG response - Options for Defined Benefit schemes - 19Apr24.pdf
BPPG response - Options for Defined Benefit schemes - 19Apr24.pdfBPPG response - Options for Defined Benefit schemes - 19Apr24.pdf
BPPG response - Options for Defined Benefit schemes - 19Apr24.pdf
 
Vp Girls near me Delhi Call Now or WhatsApp
Vp Girls near me Delhi Call Now or WhatsAppVp Girls near me Delhi Call Now or WhatsApp
Vp Girls near me Delhi Call Now or WhatsApp
 
2024 Q1 Crypto Industry Report | CoinGecko
2024 Q1 Crypto Industry Report | CoinGecko2024 Q1 Crypto Industry Report | CoinGecko
2024 Q1 Crypto Industry Report | CoinGecko
 
The Core Functions of the Bangko Sentral ng Pilipinas
The Core Functions of the Bangko Sentral ng PilipinasThe Core Functions of the Bangko Sentral ng Pilipinas
The Core Functions of the Bangko Sentral ng Pilipinas
 
《加拿大本地办假证-寻找办理Dalhousie毕业证和达尔豪斯大学毕业证书的中介代理》
《加拿大本地办假证-寻找办理Dalhousie毕业证和达尔豪斯大学毕业证书的中介代理》《加拿大本地办假证-寻找办理Dalhousie毕业证和达尔豪斯大学毕业证书的中介代理》
《加拿大本地办假证-寻找办理Dalhousie毕业证和达尔豪斯大学毕业证书的中介代理》
 
(中央兰开夏大学毕业证学位证成绩单-案例)
(中央兰开夏大学毕业证学位证成绩单-案例)(中央兰开夏大学毕业证学位证成绩单-案例)
(中央兰开夏大学毕业证学位证成绩单-案例)
 
Economics, Commerce and Trade Management: An International Journal (ECTIJ)
Economics, Commerce and Trade Management: An International Journal (ECTIJ)Economics, Commerce and Trade Management: An International Journal (ECTIJ)
Economics, Commerce and Trade Management: An International Journal (ECTIJ)
 
🔝+919953056974 🔝young Delhi Escort service Pusa Road
🔝+919953056974 🔝young Delhi Escort service Pusa Road🔝+919953056974 🔝young Delhi Escort service Pusa Road
🔝+919953056974 🔝young Delhi Escort service Pusa Road
 
NO1 WorldWide Love marriage specialist baba ji Amil Baba Kala ilam powerful v...
NO1 WorldWide Love marriage specialist baba ji Amil Baba Kala ilam powerful v...NO1 WorldWide Love marriage specialist baba ji Amil Baba Kala ilam powerful v...
NO1 WorldWide Love marriage specialist baba ji Amil Baba Kala ilam powerful v...
 
原版1:1复刻堪萨斯大学毕业证KU毕业证留信学历认证
原版1:1复刻堪萨斯大学毕业证KU毕业证留信学历认证原版1:1复刻堪萨斯大学毕业证KU毕业证留信学历认证
原版1:1复刻堪萨斯大学毕业证KU毕业证留信学历认证
 
Stock Market Brief Deck for "this does not happen often".pdf
Stock Market Brief Deck for "this does not happen often".pdfStock Market Brief Deck for "this does not happen often".pdf
Stock Market Brief Deck for "this does not happen often".pdf
 
NO1 WorldWide Genuine vashikaran specialist Vashikaran baba near Lahore Vashi...
NO1 WorldWide Genuine vashikaran specialist Vashikaran baba near Lahore Vashi...NO1 WorldWide Genuine vashikaran specialist Vashikaran baba near Lahore Vashi...
NO1 WorldWide Genuine vashikaran specialist Vashikaran baba near Lahore Vashi...
 
NO1 WorldWide online istikhara for love marriage vashikaran specialist love p...
NO1 WorldWide online istikhara for love marriage vashikaran specialist love p...NO1 WorldWide online istikhara for love marriage vashikaran specialist love p...
NO1 WorldWide online istikhara for love marriage vashikaran specialist love p...
 
Financial Leverage Definition, Advantages, and Disadvantages
Financial Leverage Definition, Advantages, and DisadvantagesFinancial Leverage Definition, Advantages, and Disadvantages
Financial Leverage Definition, Advantages, and Disadvantages
 
SBP-Market-Operations and market managment
SBP-Market-Operations and market managmentSBP-Market-Operations and market managment
SBP-Market-Operations and market managment
 
Economic Risk Factor Update: April 2024 [SlideShare]
Economic Risk Factor Update: April 2024 [SlideShare]Economic Risk Factor Update: April 2024 [SlideShare]
Economic Risk Factor Update: April 2024 [SlideShare]
 
The AES Investment Code - the go-to counsel for the most well-informed, wise...
The AES Investment Code -  the go-to counsel for the most well-informed, wise...The AES Investment Code -  the go-to counsel for the most well-informed, wise...
The AES Investment Code - the go-to counsel for the most well-informed, wise...
 
PMFBY , Pradhan Mantri Fasal bima yojna
PMFBY , Pradhan Mantri  Fasal bima yojnaPMFBY , Pradhan Mantri  Fasal bima yojna
PMFBY , Pradhan Mantri Fasal bima yojna
 
AfRESFullPaper22018EmpiricalPerformanceofRealEstateInvestmentTrustsandShareho...
AfRESFullPaper22018EmpiricalPerformanceofRealEstateInvestmentTrustsandShareho...AfRESFullPaper22018EmpiricalPerformanceofRealEstateInvestmentTrustsandShareho...
AfRESFullPaper22018EmpiricalPerformanceofRealEstateInvestmentTrustsandShareho...
 
Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...
Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...
Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...
 

Seven Reasons for Code Bloat

  • 1. Seven Reasons for Code Bloat WSG London, May 2007 Christian Heilmann
  • 2. • All of the following is licensed under a Creative Commons Attribution-Share Alike 3.0 License http://creativecommons.org/ licenses/by-sa/3.0/ which means you can re-use it by attributing anything you use to me. Go Nuts!
  • 3. • First of all: as there has been talk that there is not enough diversity in speakers on web events: – I am a foreigner – I am a pescetarian – I have flat feet – I have a sight impairment – I am ginger
  • 4. • There is a new buzzword in town: POSH • Plain Old Semantic HTML – It takes a bit of effort to make pretty – It is very good in communicating your content in a clear manner – It is glamorous to talk about it right now.
  • 5. • But today we are going to talk about BECS instead: • Bloated Embarrassing Code Solutions – Fast on their feet – Expensive to make work somewhere else – Obvious communication problems
  • 6. • One of the biggest problems of web development right now is bloat. • Bloat manifests itself in several forms: – Slow web sites – Overloaded servers – Stretched or missed deadlines – Maintenance nightmares http://www.flickr.com/photos/cliph/394713939/
  • 7. • I won’t talk about server or server side code optimization • I will not talk much about client side code optimization either. • Instead I will talk about the reasons for web site bloat.
  • 8. • We all know how to avoid bloated code. • It has been best practice for years and every Java developer has a lot to say how to optimize your CSS and JavaScript • How come we still have to deal with it?
  • 9. • Reason#1 for bloated code: • Wrong perception of time needed to accustom ourselves to a project
  • 10. • Web developers are gods • We can be allocated to any product, lay our hands on it in a Vulcan mind-meld fashion and understand immediately what is going on. • No need to plan any time for reading up or handover from the previous developer. http://www.flickr.com/photos/redux/174708127
  • 11. • Reason#2 for bloated code: • Maintenance without using the right tools
  • 12. • Maintained CSS: html body #content #mainsection li a:link{ color:#333; } html body #content #mainsection li a:visited{ color:#000; } html body #content #mainsection li a:hover{ color:#999; } html body #content #mainsection li a:active{ color:#999; }
  • 13. • Other solutions: – !important for all – Adding extra DIVs with IDs. – Inline styles or style attributes • For JavaScript: – Add another addEvent – Add an inline script – Add some inline event handlers or javascript: links
  • 14. • A hero to the rescue
  • 15. • Reason#2 for bloated code: • Bad or non-existent documentation
  • 16. • Documentation is a PITA: – You need to know the system to write it – You need to be able to communicate the system to others in an easy to understand manner. – This means a lot of time and effort. http://www.flickr.com/photos/yggg/130617194/
  • 17. • The cheap solution – Create the documentation from source code comments. – That way you don’t need to spend extra time on it. – You also ensure that only the people who originally developed the system will be able to understand the documentation. http://www.flickr.com/photos/54177448@N00/347535248/
  • 18. • A real solution – Let your development team explain the system to someone who can write in a fashion comprehensible to humans. – By all means have a good JavaDoc style API documentation. – Don’t forget the “cookbook” approach though. – Don’t bother with “hello world” examples, use real implementation scenarios instead. http://www.flickr.com/photos/sugarcoma/171016512/
  • 19. • Reason#3 for bloated code: • People do not read or look before they start
  • 20. • Sounds harsh? • First example: a very easy binary system in daily use. http://www.flickr.com/photos/eins_aaa_zivi/337910578/
  • 21. • Or take this example from Amazon. • It is a comment on my book “Beginning JavaScript with DOM Scripting and Ajax”
  • 22. I keep running into a custom object in the code examples of the book called quot;DOMhelpquot;. (…) For example, instead of using the actual DOM methods to get all the links on the page and loop through them, he shows you a line of code that just says quot;DOMhelp.getlinksquot;. Yes, that line does the same thing by accessing his object and running the regular DOM functions, but what does it teach me? Nothing. That alone is a big enough annoyance to regret buying this book. http://www.icanhascheezburger.com
  • 23. • There is no function with that name anywhere in the book. • Chapter 4 introduces the idea and rationale of JavaScript libraries and takes tool methods explained in Chapter 1 to 3 to assemble DOMhelp.js. http://www.icanhascheezburger.com
  • 24. • Another example: – A supplier of one of my clients was to build a small web site explaining functionality with slide shows. – The slide shows were JS dependent and my client asked me to send them an unobtrusive script.
  • 25. • This is what I did for them: popups = { // id of the section with the popup links popupsContainerId:’main’, // id of the login show link loginLinkId:’loginshowtrigger’, // id of the subscribe show link subscribeLinkId:’subscribeshowtrigger’, // text of the login slideshow link loginLabel:’how to login’, // text of the subscribe slideshow link subscribeLabel:’how to subscribe’,
  • 26. • This is what I did for them: init:function(){ var o = document.getElementById(popups.popupsContainerId); if(o){ popups.loginLink = document.createElement(‘a’); popups.loginLink.setAttribute(‘href’, ‘#’); popups.loginLink.appendChild(popups.loginLabel); popups.loginLink.id = popups.loginLinkId; popups.addEvent(popups.loginLink, ‘click’, popups.loginShow); o.appendChild(popups.loginLink);
  • 27. • This is what I did for them: popups.subscribeLink = document.createElement(‘a’); popups.subscribeLink.setAttribute(‘href’, ‘#’); popups.subscribeLink.appendChild(popups.subscribeLabel); popups.subscribeLink.id = popups.subscribeLinkId; popups.addEvent(popups.subscribeLink, ‘click’, popups.subscribeShow); o.appendChild(popups.subscribeLink); } }, loginShow:function(){…}, subscribeShow:function(){…}, addEvent:function(){…} } popups.addEvent(window,’load’,popups.init);
  • 28. • This is part of the HTML that came back: <a href=”javascript:popups.loginShow()”>Show login demo</a> <a href=”javascript:popups2.subscribeShow()”>Show subscribe demo</a>
  • 29. • This happened to my script: popups = { […] init:function(){ var o = document.getElementById(popups.popupsContainerId); if(o){ […] // o.appendChild(popups.loginLink); […] // o.appendChild(popups.subscribeLink); } }, loginShow:function(){…}, subscribeShow:function(){…}, addEvent:function(){…} }
  • 30. • This happened to my script: popups2 = { […] init:function(){ var o = document.getElementById(popups.popupsContainerId); if(o){ […] // o.appendChild(popups.loginLink); […] // o.appendChild(popups.subscribeLink); } }, loginShow:function(){…}, subscribeShow:function(){…}, addEvent:function(){…} } popups.addEvent(window,’load’,popups.init); popups2.addEvent(window,’load’,popups2.init);
  • 31. • Now, all of this could be explained with a pretty easy equation. People = Morons
  • 32. • However, I think the problem lies deeper. • There is a natural instinct in people to solve issues their way first and then listen to reason or trust in any information. • Take this behaviour example:
  • 33. • Man buys a ridiculously expensive technical gadget that needs assembling
  • 34. • Man looks at wonderfully designed and written manual
  • 35. • Man puts manual aside
  • 36. • Man starts assembling the gadget to the best of his knowledge
  • 37. • If things don’t fit – more pressure will do the trick.
  • 38. • Assembled product doesn’t work
  • 39. • Man shakes the product or knocks on its side or top
  • 40. • Man goes back to shop or picks up the phone and complain to the manufacturer that their product is too hard to assemble or doesn’t work
  • 41. • Clever companies discovered that pattern and style their products accordingly. • Cryptic iconography • Hard to pronounce names • Not enough or too many assembly parts (pot luck) Assembly !== Chore Assembly === Adventure http://flickr.com/photos/powerbooktrance/114531319/
  • 42.
  • 43.
  • 44. • Heilmann’s law of documentation:
  • 45. • Heilmann’s law of documentation: Your documentation is only as good as the worst recipient.
  • 47. • First follow-up fact: The worst recipient is the only person that will contact you about your documentation.
  • 49. • Second follow-up fact: This is also the only person that will write about your product elsewhere.
  • 50. • Reason#5 for bloated code: • Lack of awareness
  • 51. • A lot of times people don’t bother understanding the impact of something they use before they use it. • You see web sites that have prototype, scriptaculous (add the dots yourself), jQuery and YUI included as there was a cool demo somewhere they wanted to use.
  • 52. • With YUI you also see the wrong versions in use. Each YUI component comes in three flavours: – The minified version (no comment, no whitespace) – The normal version (for easy readability) – The debug version (with lots of comments being sent to console or logger)
  • 53. • A big problem is that scripting is considered as a given. • It is not. JavaScript can and will be disabled for some users. • This is the test case that should be tried out from time to time.
  • 54. • Make sure that those users don’t get overwhelmed with too many options and content on a single page. • If necessary, you can load the extra content with Ajax after the page has loaded. • This will also make the initial loading and rendering a lot faster.
  • 55. • As this easy testing step is not taken we have bloated web sites. • The same phenomenon shows itself when people learnt the syntax of a technology (w3schools.com anyone?) and apply this little knowledge all over the shop.
  • 56. • I am sure you have seen constructs like this: <ul> <li class=”list-item”>The Passenger</li> <li class=”list-item currentlyplaying”>Louie Louie</li> <li class=”list-item”>I want to conquer the world</li> <li class=”list-item”>Foxtrott Uniform Charlie Kilo</li> </ul> li.list-item{ padding:.5em; font- family:courier;color:#000; } li.currentlyplaying{ color:#c00; }
  • 57. CSS for the logically challenged
  • 58. • Start with a global whitespace reset *{ margin:0; padding:0; list-style:none; border:none; }
  • 59. • Now define the most common elements you use and give them a predefined style: body{ font-family:helvetica,arial,sans-serif; background:#fff; color:#333; padding:2em; } p,li { padding-bottom:.5em; line-height:1.3em; } h1,h2,h3,h4,h5,h6{ padding-bottom:.5em; }
  • 60. • Then override or extend these settings with special cases inside elements with IDs: #playlist li{ padding:1em .5em; } #header p{ border:1px solid #999; background:#ddd; } <ul id=”playlist”> <li>The Passenger</li> <li>Louie Louie</li> <li>I want to conquer the world</li> <li>Foxtrott Uniform Charlie Kilo</li> </ul>
  • 61. • Then you can detect the exceptions to the rule that need extra formatting. For these use CSS classes. #playlist li{ padding:.5em; font- family:courier;color:#000; } #playlist li.currentlyplaying { color:#c00; } <ul id=”playlist”> <li>The Passenger</li> <li class=”currentlyplaying”>Louie Louie</li> <li>I want to conquer the world</li> <li>Foxtrott Uniform Charlie Kilo</li> </ul>
  • 62. • The best thing about Cascading Style Sheets is that they do cascade. • Instead of re-define, try to re- use and extend.
  • 63. • Reason#6 for bloated code: • Failure to specialize
  • 64. • This is a tricky one. • Code bloat happens when you try to make your code do everything that is even remotely possible instead of allowing it to do one thing right. • Edge cases become more important than covering the basics.
  • 65. • The reason is that you want to meet expectations. – A script that only does one thing and that thing really well is great to use. – A script that does one thing, offers fancy options and is as generic as possible to be re- used over and over again is more appreciated.
  • 66. • This becomes most apparent in JavaScript libraries. • To me, a JS library needs to do one thing: • Make browser and language behaviour less random. • If it does that, I am happy as I do know how to write JavaScript.
  • 67. • The most acclaimed libraries do more though: – Extend the language with a new syntax – chainable methods for example – Allow access to the document in various ways: CSS selector, Xpath, background color (not yet, but who knows)
  • 68. • The rationale: easier development by avoiding verbose DOM methods. • However – HTML is the thing that is most likely to change at any time. • With DOM methods I can test every step on the way and know when something fails.
  • 69. • The other snag: compatibility of libraries. • Both method names and parameter order vary. • Not a problem, when you stick to one library. • Agencies however are likely to change technology from project to project.
  • 70. • We already had that: – Intershop – Intershop Infinity – Tridion – Immediacy – Vignette – Documentum – Focus Goal Builder – Mambo / Joomla – Typo3
  • 71. • If I want to hire a good web developer right now, I ask for the following: – HTML / Semantics – CSS – JavaScript / DOM – PHP Talk to me later! – London based or willing to commute – Always eager to improve.
  • 72. • However, if I were still working in an agency, this might be: – JavaScript – jQuery – Dojo – Apollo – Prototype – Mootools – Atlas – Google Web Kit – HTML, CSS
  • 73. • Another type of bloat is bad implementation of scripts. • Maybe some scripts should be more restrictive. • Does a multi level dropdown script or an image slideshow with transition effects really need to be possible several times in the same page?
  • 74. • JavaScript is there to help aiding the users, not to overwhelm them. • If you allow bad implementers to easily create a bloated interface you don’t follow that principle. • This may sound arrogant, but I’d rather have my scripts not used than to have them used to create inaccessible web sites.
  • 75. • Instead of trying to create “one size fits all” solutions we could create the following: – Do one job right – Be extendable – Offer extension modules.
  • 76. • Reason#7 for bloated code: • Lack of a front-end build process
  • 77. • Web Developers don’t get any Kudos. • There is a code freeze phase with a kill date on backend code. • There are build scripts that convert maintained code into live code. • The frontend however is for everyone to change.
  • 78. • HTML, CSS and JavaScript are not really programming skills. • Therefore anyone can be parachuted in to use Vi (or Emacs) on the live server to add a FONT here and a CENTER there.
  • 79. • It is tricky to get out of this, as it needs a shift in the perception of the job of a web developer. • The IWA/HWG together with the W3C is working on a web developer certification which can make us a larger blip on the radar of business. • However, right now there is a sneakier way:
  • 80. • Minify the heck out of your code before it goes live. • Concatenate all scripts into one include. • Concatenate all CSS into one include • There is a script for this available on http://www.ejeliot.com
  • 81. • Add a comment above the document stating that this was built and is not code to be edited. • Use CSS sprites to use only a few images on the whole page. – Your pages will load and render faster (less HTTP requests). • For added fun, add scary comments.
  • 82. • Examples of good comments to throw off non-web developers: <!-- built on 12.03.07 12.33 GMT Checksum E5322AE - OK, build continues --> <!-- built on 14.03.07 08.00 Checksum error!- build failed, sent notification mail --> <!-- built on 14.03.07 08.10 Checksum E5322F3 – fix initiated and successful --> <!-- verified fix mstephens 14.03.07 09.00 --> (mstephens should be someone in upper management)
  • 83. • Examples of good comments to throw off non-web developers: /* Internet Explorer hack to prevent colour bleed and sync loss*/ /* do not change order or Firefox will go into hasWrongRender mode */ <!-- Whitespace HTML rendering mode on, do not change! --> /* Last change stopped Google indexing this, please don’t change anything! */
  • 84. • Last but not least, see you at Open Hack Day on 16th of June in Alexandra Palace. • Sign up at http://www.hackday.org