SlideShare ist ein Scribd-Unternehmen logo
1 von 49
Webdev Best Practices
        Al Torreno
Who is this for?
• Application developers
• Application developers

• Anyone writing front end code on a regular
  basis
• Application developers

• Anyone writing front end code on a regular
  basis

• Product Managers
Not you?
 Don't worry
Al's Fundamental
Principle of Webdev
Al's Fundamental
Principle of Webdev
  All other best practices stem from here
Separation of concerns
   (it's not just for application development)
Back End Example
model



Back End Example
controller

             model



Back End Example
view

            controller

             model



Back End Example
Front End
content



Front End
presentation

            content



Front End
behaviour

        presentation

             content



Front End
JS

            CSS

            HTML



Front End
Why
Why
• Reusability
Why
• Reusability

• Performance
Why
• Reusability

• Performance

• SEO
Why
• Reusability

• Performance

• SEO

• Cross-browser compatibility
Why
• Reusability

• Performance

• SEO

• Cross-browser compatibility

• Maintainability
Why
• Reusability

• Performance

• SEO

• Cross-browser compatibility

• Maintainability

• "Responsive design"
Website Design
Before
<table border="0" cellspacing="0" cellpadding="0" width="100%"
height="100%">

  <tr>

    <td valign="top" width="75%" bgcolor="red"><font color="#ffffff"

size="2">Hello world</font></td>

        <td valign="top" width="25%" bgcolor="blue"><a
onmouseover="foo()"

onmouseout="bar()"

        href="http://www.google.com" style="color:#fff">Cool</a></td>

  </tr>

</table>
After - HTML
<div class="main">

 <div class="content">Hello world</
 div>

 <div class="callout"><a
 href="http://
 www.google.com">Cool</a></div>

</div>
After - CSS

body{font:12px arial;}
.main{background:#f00;}
.content{float:left; width:75%}
.callout{float:left; width:25%;}
After - JS

//using jquery
$(
 $("a").mouseover(foo).mouseout(bar)
)
Maintainability
<div style="position:absolute; top:
0; left:256px">

<span style="font-size:
12px">Hello</span> <span
style="color:red">World</span>

</div>
Maintainability
function show(num){

  if(num==1)

document.getElementById("content").
innerHTML="Hello World"

}
Missing the point


<div class"redbox200">

.redbox200{background:red; width:
200px}
Performance
Performance
From Steve Souders:
Performance
From Steve Souders:

optimize front-end performance first, that's
where 80% or more of the end-user response
time is spent.
Print stylesheets
<div class="navigation">

  <a href="#">Home</a> | <a href="#">Contact
Us</a>

</div>

<div class="content">

  <h1>Hello world</h1>

  <p>Lorem ipsum</p>

</div>
Print stylesheets
body{font:12px arial;}

h1{color:#f00; font-size:25px;}

.navigation{background:red; color:#fff;
font-size:12px; padding:10px 5px; width:
500px;}

.content{border:1px solid blue; padding:
0 3px; width:500px;}
Print stylesheets
body{font:10pt times new roman;}

h1{border-bottom:1pt solid black;
color:#000; font-size:12pt; text-
transform: uppercase; padding:0 0 3pt
0;}

.navigation{display:none}

.content{width:7.5in}
Print stylesheets
Responsive design

@media screen and (max-device-
width: 480px) {

    .column {float: none;}

}
Tempting


<div
style="background:blue">points.com
header</div>
Instead

<div class="header">points.com
header</div>



.header{background:blue}
Examples in the wild

• jQuery + jQuery UI

• Sencha Ext-js/GXT

• CSS Zen Garden
Examples in the wild

• jQuery + jQuery UI

• Sencha Ext-js/GXT

• CSS Zen Garden
Examples in the wild

• jQuery + jQuery UI

• Sencha Ext-js/GXT

• CSS Zen Garden
Clean separation

Weitere ähnliche Inhalte

Was ist angesagt?

Jager planetaire nevels
Jager planetaire nevelsJager planetaire nevels
Jager planetaire nevels
paskar
 
Ajax Jump Start
Ajax Jump StartAjax Jump Start
Ajax Jump Start
Haim Michael
 
New microsoft office word document
New microsoft office word documentNew microsoft office word document
New microsoft office word document
kolamaa
 

Was ist angesagt? (13)

Jager planetaire nevels
Jager planetaire nevelsJager planetaire nevels
Jager planetaire nevels
 
Responsive Web Design & APEX Theme 25
Responsive Web Design & APEX Theme 25Responsive Web Design & APEX Theme 25
Responsive Web Design & APEX Theme 25
 
New text document
New text documentNew text document
New text document
 
What's New in MadCap Flare v10
What's New in MadCap Flare v10What's New in MadCap Flare v10
What's New in MadCap Flare v10
 
Ajax Jump Start
Ajax Jump StartAjax Jump Start
Ajax Jump Start
 
Html 5 pres
Html 5 presHtml 5 pres
Html 5 pres
 
programming
programmingprogramming
programming
 
3D na Webu
3D na Webu3D na Webu
3D na Webu
 
Presentation html5 css3 by thibaut
Presentation html5 css3 by thibautPresentation html5 css3 by thibaut
Presentation html5 css3 by thibaut
 
Hello, Canvas.
Hello, Canvas.Hello, Canvas.
Hello, Canvas.
 
HTML5: A primer on the web's present and future
HTML5: A primer on the web's present and futureHTML5: A primer on the web's present and future
HTML5: A primer on the web's present and future
 
Biological Modelling, Powered by AngularJS
Biological Modelling, Powered by AngularJSBiological Modelling, Powered by AngularJS
Biological Modelling, Powered by AngularJS
 
New microsoft office word document
New microsoft office word documentNew microsoft office word document
New microsoft office word document
 

Ähnlich wie Clean separation

Responsive Layout Frameworks for XPages Application UI
Responsive Layout Frameworks for XPages Application UIResponsive Layout Frameworks for XPages Application UI
Responsive Layout Frameworks for XPages Application UI
Chris Toohey
 
Lect-4-Responsive-Web-06032024-082044am.pptx
Lect-4-Responsive-Web-06032024-082044am.pptxLect-4-Responsive-Web-06032024-082044am.pptx
Lect-4-Responsive-Web-06032024-082044am.pptx
zainm7032
 
SCREENS - 2012-09-28 - Responsive Web Design, get the best from your design
SCREENS - 2012-09-28 - Responsive Web Design, get the best from your designSCREENS - 2012-09-28 - Responsive Web Design, get the best from your design
SCREENS - 2012-09-28 - Responsive Web Design, get the best from your design
Frédéric Harper
 

Ähnlich wie Clean separation (20)

Nanoformats
NanoformatsNanoformats
Nanoformats
 
Practical tipsmakemobilefaster oscon2016
Practical tipsmakemobilefaster oscon2016Practical tipsmakemobilefaster oscon2016
Practical tipsmakemobilefaster oscon2016
 
Web Development for UX Designers
Web Development for UX DesignersWeb Development for UX Designers
Web Development for UX Designers
 
Let's get accessible!
Let's get accessible!Let's get accessible!
Let's get accessible!
 
Ease into HTML5 and CSS3
Ease into HTML5 and CSS3Ease into HTML5 and CSS3
Ease into HTML5 and CSS3
 
Diazo: Bridging Designers and Programmers
Diazo: Bridging Designers and ProgrammersDiazo: Bridging Designers and Programmers
Diazo: Bridging Designers and Programmers
 
Html 5 mobile - nitty gritty
Html 5 mobile - nitty grittyHtml 5 mobile - nitty gritty
Html 5 mobile - nitty gritty
 
UI 101
UI 101UI 101
UI 101
 
Adobe MAX 2008: HTML/CSS + Fireworks
Adobe MAX 2008: HTML/CSS + FireworksAdobe MAX 2008: HTML/CSS + Fireworks
Adobe MAX 2008: HTML/CSS + Fireworks
 
It's a Mod World - A Practical Guide to Rocking Modernizr
It's a Mod World - A Practical Guide to Rocking ModernizrIt's a Mod World - A Practical Guide to Rocking Modernizr
It's a Mod World - A Practical Guide to Rocking Modernizr
 
Responsive Layout Frameworks for XPages Application UI
Responsive Layout Frameworks for XPages Application UIResponsive Layout Frameworks for XPages Application UI
Responsive Layout Frameworks for XPages Application UI
 
Html5 Whats around the bend
Html5 Whats around the bendHtml5 Whats around the bend
Html5 Whats around the bend
 
JavaScript front end performance optimizations
JavaScript front end performance optimizationsJavaScript front end performance optimizations
JavaScript front end performance optimizations
 
Responsive design
Responsive designResponsive design
Responsive design
 
Bootstrap Workout 2015
Bootstrap Workout 2015Bootstrap Workout 2015
Bootstrap Workout 2015
 
HTML5, the new buzzword
HTML5, the new buzzwordHTML5, the new buzzword
HTML5, the new buzzword
 
Lect-4-Responsive-Web-06032024-082044am.pptx
Lect-4-Responsive-Web-06032024-082044am.pptxLect-4-Responsive-Web-06032024-082044am.pptx
Lect-4-Responsive-Web-06032024-082044am.pptx
 
Team styles
Team stylesTeam styles
Team styles
 
SCREENS - 2012-09-28 - Responsive Web Design, get the best from your design
SCREENS - 2012-09-28 - Responsive Web Design, get the best from your designSCREENS - 2012-09-28 - Responsive Web Design, get the best from your design
SCREENS - 2012-09-28 - Responsive Web Design, get the best from your design
 
Going web native
Going web nativeGoing web native
Going web native
 

Kürzlich hochgeladen

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Kürzlich hochgeladen (20)

Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 

Clean separation

Hinweis der Redaktion

  1. Audience - knows HTML, but not really\n\n\n
  2. \n\n
  3. \n\n
  4. separate lunch and learn beginner series\n
  5. \n\n
  6. \n\n
  7. \n\n
  8. \n\n
  9. \n\n
  10. \n\n
  11. \n\n
  12. Add example of bad code\n
  13. Probably need 3 slides, show each layer\n
  14. \n\n
  15. \n\n
  16. Presentation in the content layer\nWhat if presentation needs to change?\n
  17. \n\n
  18. \n\n
  19. \n\n
  20. \n\n
  21. \n\n
  22. \n\n
  23. \n\n
  24. \n\n
  25. \n\n
  26. Fast dev, not maintainable\n
  27. \n\n
  28. \n\n
  29. \n\n
  30. \n\n
  31. \n\n