Why I love Haml

1,356 views

Published on

A 5 minute lightening presentation on the basics of HAML and why I love it

Published in: Technology, Design
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,356
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
5
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Why I love Haml

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

    ×