SlideShare une entreprise Scribd logo
1  sur  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

Contenu connexe

Tendances

Jager planetaire nevels
Jager planetaire nevelsJager planetaire nevels
Jager planetaire nevelspaskar
 
Responsive Web Design & APEX Theme 25
Responsive Web Design & APEX Theme 25Responsive Web Design & APEX Theme 25
Responsive Web Design & APEX Theme 25Christian Rokitta
 
Presentation html5 css3 by thibaut
Presentation html5 css3 by thibautPresentation html5 css3 by thibaut
Presentation html5 css3 by thibautThibaut Baillet
 
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 futureDaniel Stout
 
Biological Modelling, Powered by AngularJS
Biological Modelling, Powered by AngularJSBiological Modelling, Powered by AngularJS
Biological Modelling, Powered by AngularJSGil Fink
 
New microsoft office word document
New microsoft office word documentNew microsoft office word document
New microsoft office word documentkolamaa
 

Tendances (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
 

Similaire à Clean separation

Nanoformats
NanoformatsNanoformats
Nanoformatsrozario
 
Practical tipsmakemobilefaster oscon2016
Practical tipsmakemobilefaster oscon2016Practical tipsmakemobilefaster oscon2016
Practical tipsmakemobilefaster oscon2016Doris Chen
 
Web Development for UX Designers
Web Development for UX DesignersWeb Development for UX Designers
Web Development for UX DesignersAshlimarie
 
Let's get accessible!
Let's get accessible!Let's get accessible!
Let's get accessible!Tady Walsh
 
Ease into HTML5 and CSS3
Ease into HTML5 and CSS3Ease into HTML5 and CSS3
Ease into HTML5 and CSS3Brian Moon
 
Diazo: Bridging Designers and Programmers
Diazo: Bridging Designers and ProgrammersDiazo: Bridging Designers and Programmers
Diazo: Bridging Designers and ProgrammersTsungWei Hu
 
Html 5 mobile - nitty gritty
Html 5 mobile - nitty grittyHtml 5 mobile - nitty gritty
Html 5 mobile - nitty grittyMario Noble
 
Adobe MAX 2008: HTML/CSS + Fireworks
Adobe MAX 2008: HTML/CSS + FireworksAdobe MAX 2008: HTML/CSS + Fireworks
Adobe MAX 2008: HTML/CSS + FireworksNathan Smith
 
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 ModernizrMichael Enslow
 
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 UIChris Toohey
 
Html5 Whats around the bend
Html5 Whats around the bendHtml5 Whats around the bend
Html5 Whats around the bendRaj Lal
 
JavaScript front end performance optimizations
JavaScript front end performance optimizationsJavaScript front end performance optimizations
JavaScript front end performance optimizationsChris Love
 
Bootstrap Workout 2015
Bootstrap Workout 2015Bootstrap Workout 2015
Bootstrap Workout 2015Rob Davarnia
 
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.pptxzainm7032
 
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 designFrédéric Harper
 

Similaire à 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
 

Dernier

Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 

Dernier (20)

Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 

Clean separation

Notes de l'éditeur

  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