SlideShare uma empresa Scribd logo
1 de 20
HAML SUCKS
by Steve Butterworth (@stevewillbe)
WHAT IS HAML
HTML Abstraction Markup Language


For HTML what CoffeeScript is for
  JavaScript and SASS is for CSS
WHAT IS HAML
                ERB:
<div id=”content” class=”key”></div>

              HAML:
            #content.key
HAML SUCKS
      ...up your superfluous characters
<div id="profile">
  <div class="left column">
     <div id="date"><%= print_date %></div>
     <div id="address"><%=
current_user.address %></div>
  </div>
  <div class="right column">
     <div id="email"><%= current_user.email
%></div>
     <div id="bio"><%= current_user.bio %></
div>
  </div>
</div>
HAML SUCKS
 ...up your superfluous characters


#profile
  .left.column
    #date= print_date
    #address= current_user.address
  .right.column
    #email= current_user.email
    #bio= current_user.bio
HAML SUCKS
         ...up badly indented html


<div id="profile"><div class="left column">
    <div id="address">23 The road</div>
  </div>
<div class="right column">
<div id="email">steve@flumes.com</div>
  </div>
</div>
HAML SUCKS
    ...up badly indented html


#profile
  .left.column
    #address= ’23 The Road’
  .right.column
    #email= ‘steve@flumes.com
HAML SUCKS
        ...up badly indented html

<div id="profile">
  <div class="left column">
    <div id="address">23 The road</div>
  </div>
  <div class="right column">
    <div id="email">steve@flumes.com</div>
  </div>
</div>
HAML SUCKS
         ...ugly attribute syntax



<div id="profile">
  <div class="left column">
    <div id="address” class=“<%= important_color
%>”/></div>
  </div>
</div>
HAML SUCKS
       ...up ugly attribute syntax



.profile
  .left.column
    #address{:class => important_color }/></div>
  </div>
</div>
HAML SUCKS
     ...up excess ruby in your views
<div id="profile">
   <div class="left column">
     <div id="address"><%
help = docs.help
title = help[:title]
%>
<%= title %></div>
   </div>
<div class="right column">
<div id="email">steve@flumes.com</div>
   </div>
</div>
HAML SUCKS
 ...up excess ruby in your views


#profile
  .left.column
    #address= lovely_helper
  .right.column
    #email= ‘steve@flumes.com’
HAML SUCKS
         ...up missing end tags


No missing missing end tags, ever.
 No debugging partials within
 partials, within partials, within
 partials, within partials to find
  where we broke the nesting
HAML SUCKS
...me and my front end guy closer together
HAML SUCKS
... because significant whitespace upsets me
IPHUG
Introducing the Ipswich HAML User Group
DHH
          ...doesn’t like it
this fact keeps me awake at night
DHH
h + erb = herb
Why I love Haml
Why I love Haml

Mais conteúdo relacionado

Mais procurados

Making Polymer Elements Accessible
Making Polymer Elements Accessible Making Polymer Elements Accessible
Making Polymer Elements Accessible
aliceboxhall
 
Using scss-at-noisestreet
Using scss-at-noisestreetUsing scss-at-noisestreet
Using scss-at-noisestreet
Wei Pin Teo
 
Ujs in rails
Ujs in railsUjs in rails
Ujs in rails
marcspark
 

Mais procurados (15)

Domain Modeling with REST
Domain Modeling with RESTDomain Modeling with REST
Domain Modeling with REST
 
Smarter Grids with Sass and Susy
Smarter Grids with Sass and SusySmarter Grids with Sass and Susy
Smarter Grids with Sass and Susy
 
Juggling
JugglingJuggling
Juggling
 
How to use CSS3 in WordPress
How to use CSS3 in WordPressHow to use CSS3 in WordPress
How to use CSS3 in WordPress
 
Intro to Sass for WordPress Developers
Intro to Sass for WordPress DevelopersIntro to Sass for WordPress Developers
Intro to Sass for WordPress Developers
 
How to use CSS3 in WordPress - Sacramento
How to use CSS3 in WordPress - SacramentoHow to use CSS3 in WordPress - Sacramento
How to use CSS3 in WordPress - Sacramento
 
“Good design is obvious. Great design is transparent.” — How we use Bootstrap...
“Good design is obvious. Great design is transparent.” — How we use Bootstrap...“Good design is obvious. Great design is transparent.” — How we use Bootstrap...
“Good design is obvious. Great design is transparent.” — How we use Bootstrap...
 
Making Polymer Elements Accessible
Making Polymer Elements Accessible Making Polymer Elements Accessible
Making Polymer Elements Accessible
 
Semantic accessibility
Semantic accessibilitySemantic accessibility
Semantic accessibility
 
How to use CSS Selector to identify Web Elements for selenium scripts
How to use CSS Selector to identify Web Elements for selenium scriptsHow to use CSS Selector to identify Web Elements for selenium scripts
How to use CSS Selector to identify Web Elements for selenium scripts
 
Building Large Web Applications That Are Easy to Maintain
Building Large Web Applications That Are Easy to MaintainBuilding Large Web Applications That Are Easy to Maintain
Building Large Web Applications That Are Easy to Maintain
 
Using scss-at-noisestreet
Using scss-at-noisestreetUsing scss-at-noisestreet
Using scss-at-noisestreet
 
Whirlwind Tour of SVG (plus RaphaelJS)
Whirlwind Tour of SVG (plus RaphaelJS)Whirlwind Tour of SVG (plus RaphaelJS)
Whirlwind Tour of SVG (plus RaphaelJS)
 
Ujs in rails
Ujs in railsUjs in rails
Ujs in rails
 
LESS CSS Pre-processor
LESS CSS Pre-processorLESS CSS Pre-processor
LESS CSS Pre-processor
 

Destaque (8)

50 Ways to Makes Sense Of Natural Language
50 Ways to Makes Sense Of Natural Language50 Ways to Makes Sense Of Natural Language
50 Ways to Makes Sense Of Natural Language
 
Rádio
RádioRádio
Rádio
 
Asset pipeline
Asset pipelineAsset pipeline
Asset pipeline
 
Idea2app
Idea2appIdea2app
Idea2app
 
HTML5 Web Workers-unleashed
HTML5 Web Workers-unleashedHTML5 Web Workers-unleashed
HTML5 Web Workers-unleashed
 
Getting Started with HTML 5 Web workers
Getting Started with HTML 5 Web workersGetting Started with HTML 5 Web workers
Getting Started with HTML 5 Web workers
 
Fotoooos
FotoooosFotoooos
Fotoooos
 
HTML5 Web Workers
HTML5 Web WorkersHTML5 Web Workers
HTML5 Web Workers
 

Semelhante a Why I love Haml

LESS CSS Processor
LESS CSS ProcessorLESS CSS Processor
LESS CSS Processor
sdhoman
 
Your Custom WordPress Admin Pages Suck
Your Custom WordPress Admin Pages SuckYour Custom WordPress Admin Pages Suck
Your Custom WordPress Admin Pages Suck
Anthony Montalbano
 
HTML5 and the dawn of rich mobile web applications pt 2
HTML5 and the dawn of rich mobile web applications pt 2HTML5 and the dawn of rich mobile web applications pt 2
HTML5 and the dawn of rich mobile web applications pt 2
James Pearce
 

Semelhante a Why I love Haml (20)

Capstone Website Code
Capstone Website CodeCapstone Website Code
Capstone Website Code
 
SuperMondays, July 2011
SuperMondays, July 2011SuperMondays, July 2011
SuperMondays, July 2011
 
LESS CSS Processor
LESS CSS ProcessorLESS CSS Processor
LESS CSS Processor
 
HTML News Packages Lesson
HTML News Packages LessonHTML News Packages Lesson
HTML News Packages Lesson
 
Writing Secure WordPress Code WordCamp NYC 2014
Writing Secure WordPress Code WordCamp NYC 2014Writing Secure WordPress Code WordCamp NYC 2014
Writing Secure WordPress Code WordCamp NYC 2014
 
Your Custom WordPress Admin Pages Suck
Your Custom WordPress Admin Pages SuckYour Custom WordPress Admin Pages Suck
Your Custom WordPress Admin Pages Suck
 
Object-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSS
Object-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSSObject-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSS
Object-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSS
 
HTML5 & CSS3 Flag
HTML5 & CSS3 FlagHTML5 & CSS3 Flag
HTML5 & CSS3 Flag
 
Html tags describe in bangla
Html tags describe in banglaHtml tags describe in bangla
Html tags describe in bangla
 
Html tag list
Html tag listHtml tag list
Html tag list
 
Gem christmas calendar
Gem christmas calendarGem christmas calendar
Gem christmas calendar
 
Rounded Shaped Box Example 1
Rounded Shaped Box Example 1Rounded Shaped Box Example 1
Rounded Shaped Box Example 1
 
Haml in 5 minutes
Haml in 5 minutesHaml in 5 minutes
Haml in 5 minutes
 
HTML5 and the dawn of rich mobile web applications pt 2
HTML5 and the dawn of rich mobile web applications pt 2HTML5 and the dawn of rich mobile web applications pt 2
HTML5 and the dawn of rich mobile web applications pt 2
 
HTML & CSS 2017
HTML & CSS 2017HTML & CSS 2017
HTML & CSS 2017
 
Emmet cheat-sheet
Emmet cheat-sheetEmmet cheat-sheet
Emmet cheat-sheet
 
jQuery Mobile - Desenvolvimento para dispositivos móveis
jQuery Mobile - Desenvolvimento para dispositivos móveisjQuery Mobile - Desenvolvimento para dispositivos móveis
jQuery Mobile - Desenvolvimento para dispositivos móveis
 
Tybscrc
TybscrcTybscrc
Tybscrc
 
HTML5
HTML5HTML5
HTML5
 
Html Hands On
Html Hands OnHtml Hands On
Html Hands On
 

Último

Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
UK Journal
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Peter Udo Diehl
 

Último (20)

Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at Comcast
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & Ireland
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - Questionnaire
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024
 

Why I love Haml

  • 1. HAML SUCKS by Steve Butterworth (@stevewillbe)
  • 2. WHAT IS HAML HTML Abstraction Markup Language For HTML what CoffeeScript is for JavaScript and SASS is for CSS
  • 3. WHAT IS HAML ERB: <div id=”content” class=”key”></div> HAML: #content.key
  • 4. HAML SUCKS ...up your superfluous characters <div id="profile"> <div class="left column"> <div id="date"><%= print_date %></div> <div id="address"><%= current_user.address %></div> </div> <div class="right column"> <div id="email"><%= current_user.email %></div> <div id="bio"><%= current_user.bio %></ div> </div> </div>
  • 5. HAML SUCKS ...up your superfluous characters #profile .left.column #date= print_date #address= current_user.address .right.column #email= current_user.email #bio= current_user.bio
  • 6. HAML SUCKS ...up badly indented html <div id="profile"><div class="left column"> <div id="address">23 The road</div> </div> <div class="right column"> <div id="email">steve@flumes.com</div> </div> </div>
  • 7. HAML SUCKS ...up badly indented html #profile .left.column #address= ’23 The Road’ .right.column #email= ‘steve@flumes.com
  • 8. HAML SUCKS ...up badly indented html <div id="profile"> <div class="left column"> <div id="address">23 The road</div> </div> <div class="right column"> <div id="email">steve@flumes.com</div> </div> </div>
  • 9. HAML SUCKS ...ugly attribute syntax <div id="profile"> <div class="left column"> <div id="address” class=“<%= important_color %>”/></div> </div> </div>
  • 10. HAML SUCKS ...up ugly attribute syntax .profile .left.column #address{:class => important_color }/></div> </div> </div>
  • 11. HAML SUCKS ...up excess ruby in your views <div id="profile"> <div class="left column"> <div id="address"><% help = docs.help title = help[:title] %> <%= title %></div> </div> <div class="right column"> <div id="email">steve@flumes.com</div> </div> </div>
  • 12. HAML SUCKS ...up excess ruby in your views #profile .left.column #address= lovely_helper .right.column #email= ‘steve@flumes.com’
  • 13. HAML SUCKS ...up missing end tags No missing missing end tags, ever. No debugging partials within partials, within partials, within partials, within partials to find where we broke the nesting
  • 14. HAML SUCKS ...me and my front end guy closer together
  • 15. HAML SUCKS ... because significant whitespace upsets me
  • 16. IPHUG Introducing the Ipswich HAML User Group
  • 17. DHH ...doesn’t like it this fact keeps me awake at night
  • 18. DHH h + erb = herb

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