SlideShare uma empresa Scribd logo
1 de 73
Best Practices
   every HTML5
 developer should
       know
     Michael Mahemoff, Nuvomondo Ltd
   At Intel AppLab, Mobile World Congress
                t: @mahemoff
                g: +mahemoff
Will be online at Intel AppUp blog


     http://intel.ly/appupblog


Please use #html5best hashtag



                #html5best - @mahemoff - Intel AppUp - MWC
ABOUT YOUR SPEAKER
            UX




              http://www.flickr.com/photos/ideapaint/4821634406/sizes/l/in/photostream/


        #html5best - @mahemoff - Intel AppUp - MWC
ABOUT YOUR SPEAKER
              UX



   2005




                http://www.flickr.com/photos/ideapaint/4821634406/sizes/l/in/photostream/


          #html5best - @mahemoff - Intel AppUp - MWC
ABOUT YOUR SPEAKER
              UX



   2005




                http://www.flickr.com/photos/ideapaint/4821634406/sizes/l/in/photostream/


          #html5best - @mahemoff - Intel AppUp - MWC
1. Up and Running

  2. Move Fast

    3. Grow


        #html5best - @mahemoff - Intel AppUp - MWC
Up and
Running
first steps to glory
EARLY FEEDBACK:
FAIL EARLY, FAIL FAST




           #html5best - @mahemoff - Intel AppUp - MWC
@mahemoff - Intel AppUp - MWC
REUSE




   #html5best - @mahemoff - Intel AppUp - MWC
Libraries: Syntactic Sugar

Generic Libraries


 DOM Manipulation
 $(‘.food’).delete();

 Networking
 $.put(‘/orders’, { foods: [‘sushi’, ‘yakitori’] });

 Data Wrangling
 _(foods).select(function(food) { return food.isCold(); });



                               #html5best - @mahemoff - Intel AppUp - MWC
Reuse

Specialised libraries and frameworks

 Graphics
 Parsing
 Verticals (e.g. gaming)
 etc etc



                           #html5best - @mahemoff - Intel AppUp - MWC
A Layout Example: Pinterest in 4 Lines ;)
$(‘.container’).masonry({
  itemSelector: ‘.item’,
  columnWidth: 240
});




                          #html5best - @mahemoff - Intel AppUp - MWC
Web Components: Roll-Your-Own?

<element extends="button" name="x-spreadsheet">
    …

                                                                                           Very
</element>



                                                                                Expe!
<x-spreadsheet>


                                                                                      mental
  10,5,1,8, ...
</x-spreadsheet>
   http://dvcs.w3.org/hg/webcomponents/raw-file/tip/explainer/index.html




                                                                          #html5best - @mahemoff - Intel AppUp - MWC
FRAMEWORKS




     #html5best - @mahemoff - Intel AppUp - MWC
#html5best - @mahemoff - Intel AppUp - MWC
Twitter Bootstrap




        #html5best - @mahemoff - Intel AppUp - MWC
Responsive Web Design




          #html5best - @mahemoff - Intel AppUp - MWC
Responsive Web Design




          #html5best - @mahemoff - Intel AppUp - MWC
Responsive Web Design
.column { width: 240px; }




             #html5best - @mahemoff - Intel AppUp - MWC
Responsive Web Design
.column { width: 240px; }
@media (max-width: 480px) {
  .column { width: 100%; }
}




             #html5best - @mahemoff - Intel AppUp - MWC
#html5best - @mahemoff - Intel AppUp - MWC
http://musicmak.es




        #html5best - @mahemoff - Intel AppUp - MWC
Move
     Fast
optimising for productivity
Single Page App is Here
            #html5best - @mahemoff - Intel AppUp - MWC
RESTful Services




Single Page App




            @mahemoff - Intel AppUp - MWC
RESTful Services




Single Page App




            @mahemoff - Intel AppUp - MWC
RESTful Services




Single Page App




            @mahemoff - Intel AppUp - MWC
RESTful Services




Single Page App




            @mahemoff - Intel AppUp - MWC
MODERN SPA:
BETTER SYNTAX

    CSS++

     JS++

    HTML++



        #html5best - @mahemoff - Intel AppUp - MWC
CSS: Don’t Repeat Yourself

div {
   background: rgb(136, 33, 149);
   filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#882195',
endColorstr='#A43CB3',GradientType=0);
   background-image: linear-gradient(bottom, rgb(104,7,114) 46%, rgb(136,33,149) 73%,
rgb(164,60,179) 87%);
   background-image: -o-linear-gradient(bottom, rgb(104,7,114) 46%, rgb(136,33,149)
73%, rgb(164,60,179) 87%);
   background-image: -moz-linear-gradient(bottom, rgb(104,7,114) 46%, rgb(136,33,149)
73%, rgb(164,60,179) 87%);
   background-image: -webkit-linear-gradient(bottom, rgb(104,7,114) 46%,
rgb(136,33,149) 73%, rgb(164,60,179) 87%);
   background-image: -ms-linear-gradient(bottom, rgb(104,7,114) 46%, rgb(136,33,149)
73%, rgb(164,60,179) 87%);
   background-image: -webkit-gradient(
! linear, left bottom, left top, color-stop(0.46, rgb(104,7,114)), color-stop(0.73,
rgb(136,33,149)),
      color-stop(0.87, rgb(164,60,179))
   );
 }


                                           #html5best - @mahemoff - Intel AppUp - MWC
CSS: Don’t Repeat Yourself

div {
   background: rgb(136, 33, 149);
   filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#882195',
endColorstr='#A43CB3',GradientType=0);
   background-image: linear-gradient(bottom, rgb(104,7,114) 46%, rgb(136,33,149) 73%,
rgb(164,60,179) 87%);
   background-image: -o-linear-gradient(bottom, rgb(104,7,114) 46%, rgb(136,33,149)
73%, rgb(164,60,179) 87%);
   background-image: -moz-linear-gradient(bottom, rgb(104,7,114) 46%, rgb(136,33,149)
73%, rgb(164,60,179) 87%);
   background-image: -webkit-linear-gradient(bottom, rgb(104,7,114) 46%,
rgb(136,33,149) 73%, rgb(164,60,179) 87%);
   background-image: -ms-linear-gradient(bottom, rgb(104,7,114) 46%, rgb(136,33,149)
73%, rgb(164,60,179) 87%);
   background-image: -webkit-gradient(
! linear, left bottom, left top, color-stop(0.46, rgb(104,7,114)), color-stop(0.73,
rgb(136,33,149)),
      color-stop(0.87, rgb(164,60,179))
   );
 }


                                           #html5best - @mahemoff - Intel AppUp - MWC
STYLUS: A “CSS++” COMPILER

        Stylus

div {
  background-image: linear-gradient
   (bottom,
    rgb(104,7,114) 46%,
    rgb(136,33,149) 73%, rgb(164,60,179) 87%);
}




                               #html5best - @mahemoff - Intel AppUp - MWC
STYLUS

        Stylus
div
  background-image linear-gradient
    (bottom,
    rgb(104,7,114) 46%,
    rgb(136,33,149) 73%,
    rgb(164,60,179) 87%)




                               #html5best - @mahemoff - Intel AppUp - MWC
STYLUS

        Stylus

div
  background triple-gradient
  (rgb(104,7,114), rgb(136,33,149), rgb(164,60,179))




                               #html5best - @mahemoff - Intel AppUp - MWC
STYLUS
        Stylus

themeBG = rgb(78,155,100)
div
  background triple-gradient
  (themeBG, themeBG*1.2, themeBG*1.2 + #003)




                               #html5best - @mahemoff - Intel AppUp - MWC
COFFEESCRIPT
eat = -> f.delete()
function eat() {
  f.delete();
}


eat sushi
eat(sushi);


$(‘.meal’).whenServed -> eat food
$(‘.meal’).whenServed(function() {
  eat(food);
});




              #html5best - @mahemoff - Intel AppUp - MWC
COFFEESCRIPT
foods =
  miso: 4
  teriyaki: 6
  sushi: 12


condiments = (food.sauce for food of foods)
price = (if sushi then 12 else 4)


fetch chopsticks if food isnt miso
fetch chopsticks unless food is miso




                #html5best - @mahemoff - Intel AppUp - MWC
JADE
!!! 5
html(lang="en")
  head
    title= pageTitle
    script(type='text/javascript')
       if (foo) {
          bar()
       }
  body
    h1 Jade - node template engine
    #container
       - if (youAreUsingJade)
         p You are amazing
       - else
         p Get on it!




                  #html5best - @mahemoff - Intel AppUp - MWC
Grow
more features, less headaches
Modules

     @mahemoff - Intel AppUp - MWC
Tight Coupling is Your Enemy
Tight Coupling is Your Enemy
@mahemoff - Intel AppUp - MWC
#HighCohesion #LowCoupling
   #Modularity #Isolation
  #SeparationOfConcerns
                 @mahemoff - Intel AppUp - MWC
#Widget #WebComponent
 #DomainObject #Module
               @mahemoff - Intel AppUp - MWC
A runtime configuration
               @mahemoff - Intel AppUp - MWC
Mediator




           @mahemoff - Intel AppUp - MWC
Good: No more coupling
                @mahemoff - Intel AppUp - MWC
Good: No more coupling
                @mahemoff - Intel AppUp - MWC
Good: Reuse elsewhere
               @mahemoff - Intel AppUp - MWC
Test
        Driver




Good: We can test!
                 @mahemoff - Intel AppUp - MWC
Model-View
Separation
      @mahemoff - Intel AppUp - MWC
Manage Your Architecture




            #html5best - @mahemoff - Intel AppUp - MWC
Manage Your Architecture




            #html5best - @mahemoff - Intel AppUp - MWC
var Book =                      <article class=”bookThumbnail”>
Backbone.Model.extend({           ...
  function countWords() {...}   </article>
});
var BookThumbnail =
Backbone.View.extend({...}




                                          @mahemoff - Intel AppUp - MWC
Templating
<article class=‘bookThumbnail’>
  <header>
    <h1 class=’title’>{{title}}</h1>
    <img class=’hero’>{{hero}}</img>
  </header>
  <div class=‘author’>{{author}}</div>
</article>




                             @mahemoff - Intel AppUp - MWC
Templating
<article class=‘bookThumbnail’>
 <header>                                                <article class=‘bookThumbnail’>

  <h1 class=’title’>{{title}}</h1>  Model            C    <header>
                                                           <h1 class=’title’>Barcelona at Noon</h1>
  <img class=’hero’>{{hero}}</img>                         <img class=’hero’>bnoon.png</img>
                                                          </header>
 </header>                                                <div class=‘author’>A. Medio</div>
 <div class=‘author’>{{author}}</div>                    </article>
</article>
                                             Model B
                      Model A
                                             <article class=‘bookThumbnail’>
<article class=‘bookThumbnail’>               <header>
 <header>                                      <h1 class=’title’>Barcelona Nights</h1>
  <h1 class=’title’>Barcelona Days</h1>        <img class=’hero’>bnights.png</img>
  <img class=’hero’>bdays.png</img>           </header>
 </header>                                    <div class=‘author’>A. Nochez</div>
 <div class=‘author’>A. Diaz</div>           </article>
</article>




                                                                  @mahemoff - Intel AppUp - MWC
OOCSS
Credit:	 Nicole	 Sullivan

                       @mahemoff - Intel AppUp - MWC
h1 #account{
  background: blue;
  font-family: arial;
}

#app h1 #account {
  background: red;
}

#footer #account {
  border-color: black;
}

          The Problem:
           CSS Jungle
                     #html5best - @mahemoff - Intel AppUp - MWC
.account {
  background: #f9a;
}

.heading {
  color: #882;
}



          Solution:
 Use classes, not IDs or Tags
                      #html5best - @mahemoff - Intel AppUp - MWC
.account {
  background: #f9a;
}

.heading {
  color: #882;
}




           Solution:
       Avoid hierarchies
                      #html5best - @mahemoff - Intel AppUp - MWC
Classy
HTML
     @mahemoff - Intel AppUp - MWC
Logged in?
                                       Show name



 Allowed to                    Managing your
    rate?                         page?
Show thumbs                  Show edit controls

          Leaving a comment?
             Show textarea

    The Problem: Display Logic
                     #html5best - @mahemoff - Intel AppUp - MWC
function startEditing() {
  $(‘.titleInput’).show();
  $(‘.mixPanel’).slideDown();
  $(‘.comments’).fadeOut();
}

function stopEditing() {
  $(‘.titleInput’).hide();
  $(‘.mixPanel’).slideUp();
  $(‘.comments’).fadeIn();
}



The Problem: Display Logic
                   #html5best - @mahemoff - Intel AppUp - MWC
$('html’).addClass(‘editing’);
$('html’).removeClass(‘editing’);



.mixPanel {
  display: none;
}

.editing .mixPanel {
  display: block;
}


  Solution: Root-level class
                   #html5best - @mahemoff - Intel AppUp - MWC
<div class=‘mixPanel forEditing’>
  ...
</div>


.forEditing {
  display: none;
}

.editing .forEditing {
  display: block;
}


        Generalising It
                   #html5best - @mahemoff - Intel AppUp - MWC
Want
  to
Learn
More?
ONLINE RESOURCES



http://diveintohtml5.info     http://developer.mozilla.org




  http://html5rocks.com         http://is.gd/frontendfeeds
                            #html5best - @mahemoff - Intel AppUp - MWC
#html5best - @mahemoff - Intel AppUp - MWC
Resources




http://addyosmani.com/blog/patterns-for-large-scale-javascript-application-architecture/


                                              #html5best - @mahemoff - Intel AppUp - MWC
Resources




http://www.slideshare.net/nzakas/scalable-javascript-application-architecture

                                         #html5best - @mahemoff - Intel AppUp - MWC
Thankyou
Online at http://intel.ly/appupblog soon ...

           Michael Mahemoff
             @mahemoff
              +mahemoff

Mais conteúdo relacionado

Último

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 

Último (20)

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

Destaque

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Destaque (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Best Practices Every HTML5 Developer Should Know

  • 1. Best Practices every HTML5 developer should know Michael Mahemoff, Nuvomondo Ltd At Intel AppLab, Mobile World Congress t: @mahemoff g: +mahemoff
  • 2. Will be online at Intel AppUp blog http://intel.ly/appupblog Please use #html5best hashtag #html5best - @mahemoff - Intel AppUp - MWC
  • 3. ABOUT YOUR SPEAKER UX http://www.flickr.com/photos/ideapaint/4821634406/sizes/l/in/photostream/ #html5best - @mahemoff - Intel AppUp - MWC
  • 4. ABOUT YOUR SPEAKER UX 2005 http://www.flickr.com/photos/ideapaint/4821634406/sizes/l/in/photostream/ #html5best - @mahemoff - Intel AppUp - MWC
  • 5. ABOUT YOUR SPEAKER UX 2005 http://www.flickr.com/photos/ideapaint/4821634406/sizes/l/in/photostream/ #html5best - @mahemoff - Intel AppUp - MWC
  • 6. 1. Up and Running 2. Move Fast 3. Grow #html5best - @mahemoff - Intel AppUp - MWC
  • 8. EARLY FEEDBACK: FAIL EARLY, FAIL FAST #html5best - @mahemoff - Intel AppUp - MWC
  • 9. @mahemoff - Intel AppUp - MWC
  • 10. REUSE #html5best - @mahemoff - Intel AppUp - MWC
  • 11. Libraries: Syntactic Sugar Generic Libraries DOM Manipulation $(‘.food’).delete(); Networking $.put(‘/orders’, { foods: [‘sushi’, ‘yakitori’] }); Data Wrangling _(foods).select(function(food) { return food.isCold(); }); #html5best - @mahemoff - Intel AppUp - MWC
  • 12. Reuse Specialised libraries and frameworks Graphics Parsing Verticals (e.g. gaming) etc etc #html5best - @mahemoff - Intel AppUp - MWC
  • 13. A Layout Example: Pinterest in 4 Lines ;) $(‘.container’).masonry({ itemSelector: ‘.item’, columnWidth: 240 }); #html5best - @mahemoff - Intel AppUp - MWC
  • 14. Web Components: Roll-Your-Own? <element extends="button" name="x-spreadsheet"> … Very </element> Expe! <x-spreadsheet> mental 10,5,1,8, ... </x-spreadsheet> http://dvcs.w3.org/hg/webcomponents/raw-file/tip/explainer/index.html #html5best - @mahemoff - Intel AppUp - MWC
  • 15. FRAMEWORKS #html5best - @mahemoff - Intel AppUp - MWC
  • 16. #html5best - @mahemoff - Intel AppUp - MWC
  • 17. Twitter Bootstrap #html5best - @mahemoff - Intel AppUp - MWC
  • 18. Responsive Web Design #html5best - @mahemoff - Intel AppUp - MWC
  • 19. Responsive Web Design #html5best - @mahemoff - Intel AppUp - MWC
  • 20. Responsive Web Design .column { width: 240px; } #html5best - @mahemoff - Intel AppUp - MWC
  • 21. Responsive Web Design .column { width: 240px; } @media (max-width: 480px) { .column { width: 100%; } } #html5best - @mahemoff - Intel AppUp - MWC
  • 22. #html5best - @mahemoff - Intel AppUp - MWC
  • 23. http://musicmak.es #html5best - @mahemoff - Intel AppUp - MWC
  • 24. Move Fast optimising for productivity
  • 25. Single Page App is Here #html5best - @mahemoff - Intel AppUp - MWC
  • 26. RESTful Services Single Page App @mahemoff - Intel AppUp - MWC
  • 27. RESTful Services Single Page App @mahemoff - Intel AppUp - MWC
  • 28. RESTful Services Single Page App @mahemoff - Intel AppUp - MWC
  • 29. RESTful Services Single Page App @mahemoff - Intel AppUp - MWC
  • 30. MODERN SPA: BETTER SYNTAX CSS++ JS++ HTML++ #html5best - @mahemoff - Intel AppUp - MWC
  • 31. CSS: Don’t Repeat Yourself div { background: rgb(136, 33, 149); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#882195', endColorstr='#A43CB3',GradientType=0); background-image: linear-gradient(bottom, rgb(104,7,114) 46%, rgb(136,33,149) 73%, rgb(164,60,179) 87%); background-image: -o-linear-gradient(bottom, rgb(104,7,114) 46%, rgb(136,33,149) 73%, rgb(164,60,179) 87%); background-image: -moz-linear-gradient(bottom, rgb(104,7,114) 46%, rgb(136,33,149) 73%, rgb(164,60,179) 87%); background-image: -webkit-linear-gradient(bottom, rgb(104,7,114) 46%, rgb(136,33,149) 73%, rgb(164,60,179) 87%); background-image: -ms-linear-gradient(bottom, rgb(104,7,114) 46%, rgb(136,33,149) 73%, rgb(164,60,179) 87%); background-image: -webkit-gradient( ! linear, left bottom, left top, color-stop(0.46, rgb(104,7,114)), color-stop(0.73, rgb(136,33,149)), color-stop(0.87, rgb(164,60,179)) ); } #html5best - @mahemoff - Intel AppUp - MWC
  • 32. CSS: Don’t Repeat Yourself div { background: rgb(136, 33, 149); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#882195', endColorstr='#A43CB3',GradientType=0); background-image: linear-gradient(bottom, rgb(104,7,114) 46%, rgb(136,33,149) 73%, rgb(164,60,179) 87%); background-image: -o-linear-gradient(bottom, rgb(104,7,114) 46%, rgb(136,33,149) 73%, rgb(164,60,179) 87%); background-image: -moz-linear-gradient(bottom, rgb(104,7,114) 46%, rgb(136,33,149) 73%, rgb(164,60,179) 87%); background-image: -webkit-linear-gradient(bottom, rgb(104,7,114) 46%, rgb(136,33,149) 73%, rgb(164,60,179) 87%); background-image: -ms-linear-gradient(bottom, rgb(104,7,114) 46%, rgb(136,33,149) 73%, rgb(164,60,179) 87%); background-image: -webkit-gradient( ! linear, left bottom, left top, color-stop(0.46, rgb(104,7,114)), color-stop(0.73, rgb(136,33,149)), color-stop(0.87, rgb(164,60,179)) ); } #html5best - @mahemoff - Intel AppUp - MWC
  • 33. STYLUS: A “CSS++” COMPILER Stylus div { background-image: linear-gradient (bottom, rgb(104,7,114) 46%, rgb(136,33,149) 73%, rgb(164,60,179) 87%); } #html5best - @mahemoff - Intel AppUp - MWC
  • 34. STYLUS Stylus div background-image linear-gradient (bottom, rgb(104,7,114) 46%, rgb(136,33,149) 73%, rgb(164,60,179) 87%) #html5best - @mahemoff - Intel AppUp - MWC
  • 35. STYLUS Stylus div background triple-gradient (rgb(104,7,114), rgb(136,33,149), rgb(164,60,179)) #html5best - @mahemoff - Intel AppUp - MWC
  • 36. STYLUS Stylus themeBG = rgb(78,155,100) div background triple-gradient (themeBG, themeBG*1.2, themeBG*1.2 + #003) #html5best - @mahemoff - Intel AppUp - MWC
  • 37. COFFEESCRIPT eat = -> f.delete() function eat() { f.delete(); } eat sushi eat(sushi); $(‘.meal’).whenServed -> eat food $(‘.meal’).whenServed(function() { eat(food); }); #html5best - @mahemoff - Intel AppUp - MWC
  • 38. COFFEESCRIPT foods = miso: 4 teriyaki: 6 sushi: 12 condiments = (food.sauce for food of foods) price = (if sushi then 12 else 4) fetch chopsticks if food isnt miso fetch chopsticks unless food is miso #html5best - @mahemoff - Intel AppUp - MWC
  • 39. JADE !!! 5 html(lang="en") head title= pageTitle script(type='text/javascript') if (foo) { bar() } body h1 Jade - node template engine #container - if (youAreUsingJade) p You are amazing - else p Get on it! #html5best - @mahemoff - Intel AppUp - MWC
  • 41. Modules @mahemoff - Intel AppUp - MWC
  • 42. Tight Coupling is Your Enemy
  • 43. Tight Coupling is Your Enemy
  • 44. @mahemoff - Intel AppUp - MWC
  • 45. #HighCohesion #LowCoupling #Modularity #Isolation #SeparationOfConcerns @mahemoff - Intel AppUp - MWC
  • 46. #Widget #WebComponent #DomainObject #Module @mahemoff - Intel AppUp - MWC
  • 47. A runtime configuration @mahemoff - Intel AppUp - MWC
  • 48. Mediator @mahemoff - Intel AppUp - MWC
  • 49. Good: No more coupling @mahemoff - Intel AppUp - MWC
  • 50. Good: No more coupling @mahemoff - Intel AppUp - MWC
  • 51. Good: Reuse elsewhere @mahemoff - Intel AppUp - MWC
  • 52. Test Driver Good: We can test! @mahemoff - Intel AppUp - MWC
  • 53. Model-View Separation @mahemoff - Intel AppUp - MWC
  • 54. Manage Your Architecture #html5best - @mahemoff - Intel AppUp - MWC
  • 55. Manage Your Architecture #html5best - @mahemoff - Intel AppUp - MWC
  • 56. var Book = <article class=”bookThumbnail”> Backbone.Model.extend({ ... function countWords() {...} </article> }); var BookThumbnail = Backbone.View.extend({...} @mahemoff - Intel AppUp - MWC
  • 57. Templating <article class=‘bookThumbnail’> <header> <h1 class=’title’>{{title}}</h1> <img class=’hero’>{{hero}}</img> </header> <div class=‘author’>{{author}}</div> </article> @mahemoff - Intel AppUp - MWC
  • 58. Templating <article class=‘bookThumbnail’> <header> <article class=‘bookThumbnail’> <h1 class=’title’>{{title}}</h1> Model C <header> <h1 class=’title’>Barcelona at Noon</h1> <img class=’hero’>{{hero}}</img> <img class=’hero’>bnoon.png</img> </header> </header> <div class=‘author’>A. Medio</div> <div class=‘author’>{{author}}</div> </article> </article> Model B Model A <article class=‘bookThumbnail’> <article class=‘bookThumbnail’> <header> <header> <h1 class=’title’>Barcelona Nights</h1> <h1 class=’title’>Barcelona Days</h1> <img class=’hero’>bnights.png</img> <img class=’hero’>bdays.png</img> </header> </header> <div class=‘author’>A. Nochez</div> <div class=‘author’>A. Diaz</div> </article> </article> @mahemoff - Intel AppUp - MWC
  • 59. OOCSS Credit: Nicole Sullivan @mahemoff - Intel AppUp - MWC
  • 60. h1 #account{ background: blue; font-family: arial; } #app h1 #account { background: red; } #footer #account { border-color: black; } The Problem: CSS Jungle #html5best - @mahemoff - Intel AppUp - MWC
  • 61. .account { background: #f9a; } .heading { color: #882; } Solution: Use classes, not IDs or Tags #html5best - @mahemoff - Intel AppUp - MWC
  • 62. .account { background: #f9a; } .heading { color: #882; } Solution: Avoid hierarchies #html5best - @mahemoff - Intel AppUp - MWC
  • 63. Classy HTML @mahemoff - Intel AppUp - MWC
  • 64. Logged in? Show name Allowed to Managing your rate? page? Show thumbs Show edit controls Leaving a comment? Show textarea The Problem: Display Logic #html5best - @mahemoff - Intel AppUp - MWC
  • 65. function startEditing() { $(‘.titleInput’).show(); $(‘.mixPanel’).slideDown(); $(‘.comments’).fadeOut(); } function stopEditing() { $(‘.titleInput’).hide(); $(‘.mixPanel’).slideUp(); $(‘.comments’).fadeIn(); } The Problem: Display Logic #html5best - @mahemoff - Intel AppUp - MWC
  • 66. $('html’).addClass(‘editing’); $('html’).removeClass(‘editing’); .mixPanel { display: none; } .editing .mixPanel { display: block; } Solution: Root-level class #html5best - @mahemoff - Intel AppUp - MWC
  • 67. <div class=‘mixPanel forEditing’> ... </div> .forEditing { display: none; } .editing .forEditing { display: block; } Generalising It #html5best - @mahemoff - Intel AppUp - MWC
  • 69. ONLINE RESOURCES http://diveintohtml5.info http://developer.mozilla.org http://html5rocks.com http://is.gd/frontendfeeds #html5best - @mahemoff - Intel AppUp - MWC
  • 70. #html5best - @mahemoff - Intel AppUp - MWC
  • 73. Thankyou Online at http://intel.ly/appupblog soon ... Michael Mahemoff @mahemoff +mahemoff

Notas do Editor

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n