SlideShare ist ein Scribd-Unternehmen logo
1 von 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
HAML Sucks: Why Steve Butterworth Thinks It's Overrated
HAML Sucks: Why Steve Butterworth Thinks It's Overrated

Weitere ähnliche Inhalte

Was ist angesagt?

Domain Modeling with REST
Domain Modeling with RESTDomain Modeling with REST
Domain Modeling with RESTBen Scofield
 
Smarter Grids with Sass and Susy
Smarter Grids with Sass and SusySmarter Grids with Sass and Susy
Smarter Grids with Sass and SusyMichelle Barker
 
How to use CSS3 in WordPress
How to use CSS3 in WordPressHow to use CSS3 in WordPress
How to use CSS3 in WordPressSuzette Franck
 
Intro to Sass for WordPress Developers
Intro to Sass for WordPress DevelopersIntro to Sass for WordPress Developers
Intro to Sass for WordPress DevelopersSuzette Franck
 
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 - SacramentoSuzette Franck
 
“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...Roni Banerjee
 
Making Polymer Elements Accessible
Making Polymer Elements Accessible Making Polymer Elements Accessible
Making Polymer Elements Accessible aliceboxhall
 
Semantic accessibility
Semantic accessibilitySemantic accessibility
Semantic accessibilityIan Stuart
 
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 scriptsSokunthaneth Chhoy
 
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 MaintainMarsBased
 
Using scss-at-noisestreet
Using scss-at-noisestreetUsing scss-at-noisestreet
Using scss-at-noisestreetWei Pin Teo
 
Whirlwind Tour of SVG (plus RaphaelJS)
Whirlwind Tour of SVG (plus RaphaelJS)Whirlwind Tour of SVG (plus RaphaelJS)
Whirlwind Tour of SVG (plus RaphaelJS)Marc Grabanski
 
Ujs in rails
Ujs in railsUjs in rails
Ujs in railsmarcspark
 
LESS CSS Pre-processor
LESS CSS Pre-processorLESS CSS Pre-processor
LESS CSS Pre-processorKannika Kong
 

Was ist angesagt? (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
 

Andere mochten auch

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 LanguageFlumes
 
Asset pipeline
Asset pipelineAsset pipeline
Asset pipelineFlumes
 
Idea2app
Idea2appIdea2app
Idea2appFlumes
 
HTML5 Web Workers-unleashed
HTML5 Web Workers-unleashedHTML5 Web Workers-unleashed
HTML5 Web Workers-unleashedPeter Lubbers
 
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 workersFlumes
 

Andere mochten auch (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
 

Ähnlich wie HAML Sucks: Why Steve Butterworth Thinks It's Overrated

LESS CSS Processor
LESS CSS ProcessorLESS CSS Processor
LESS CSS Processorsdhoman
 
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 2014Brad Williams
 
Your Custom WordPress Admin Pages Suck
Your Custom WordPress Admin Pages SuckYour Custom WordPress Admin Pages Suck
Your Custom WordPress Admin Pages SuckAnthony Montalbano
 
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 到 AMCSSLi-Wei Lu
 
Gem christmas calendar
Gem christmas calendarGem christmas calendar
Gem christmas calendarerichsen
 
Rounded Shaped Box Example 1
Rounded Shaped Box Example 1Rounded Shaped Box Example 1
Rounded Shaped Box Example 1Sibananda Panda
 
Haml in 5 minutes
Haml in 5 minutesHaml in 5 minutes
Haml in 5 minutescameronbot
 
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 2James Pearce
 
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óveisPablo Garrido
 

Ähnlich wie HAML Sucks: Why Steve Butterworth Thinks It's Overrated (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 tag list
Html tag listHtml tag list
Html tag list
 
Html tags describe in bangla
Html tags describe in banglaHtml tags describe in bangla
Html tags describe in bangla
 
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
 

Kürzlich hochgeladen

What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
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
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
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
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
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
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
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
 
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
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
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
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 

Kürzlich hochgeladen (20)

What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
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
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
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
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
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
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
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
 
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
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
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
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 

HAML Sucks: Why Steve Butterworth Thinks It's Overrated

  • 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

Hinweis der Redaktion

  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