Some days ago I have started thinking about "why I hate languages with blocks by indentation while I love Haml, Slim or Sass?". Finally I found answer:
HTML is a tree structure, my code is not
What does it mean? That when I write my HTML I can think about it as a drawing
a DOM tree. We have a root element
<html> and then we create its children,
and children of his children, and children of these children, so on... We can
display this like tree, i.e.
So if we write our code using off-side rule, then we can display our tree in plain text
html head title Some title meta encoding='utf-8' link href='style.css' script src='script.js' body header div#content footer
But I am programmer and I know that indentation is important. I don't always
have time to create it by myself so in curly or keyworded languages
I can use some external help. In Vim, i.e., there is nice functionality that
after I press
=G it will reindent file from line with cursor to end of file.
So conclusion is that I love writing my code indented, but not when I forced to, as my code isn't tree and I cannot predict it flow (in CoffeeScript). In the other hand I love off-side HTML preprocessors as there I have my DOM tree displayed directly in my editor.