3 ms·
Very interesting information. Definitely going to have a look at a few gems after this. Thanks for sharing. On a side note, HAML is the best example of technol
by nahname 14y ago
Very interesting information. Definitely going to have a look at a few gems after this. Thanks for sharing.
On a side note, HAML is the best example of technology for technologies sake. It adds a small amount of value while adding the complexity of a new language. I've never felt the "juice was worth the squeeze" so to speak. Curious as to why it has the following that it does.
- Groxx 14y agoNever making invalid markup is handy, and if you have easy access to attributes you can: .a_class{ attrs } some text which can save a lot when you would otherwise have to write: <div class="a_class" attr="value" another="val" dont="forget to escape"> some text </div> The never-invalid markup is probably the bigger win, though. Primitive type checking for your HTML is arguably better than none. What I would really like is something similarly terse but faster - HAML can get pretty slow.
- nahname 14y agoI cannot say I have had many problems with incorrect HTML. Since using HAML, I have had tabbing issues, inline javascript issues, a new syntax to learn (and translate). The last one is my main issue. 80% of your time spent with HTML is in the browser, the mental translation is more of a tax than anything. I have used HAML on three projects and it always feels like it gets in the way more than it helps.
- Groxx 14y agoOn a couple big projects, I've generally liked it - since there's less boilerplate ("<>" and closing tags in particular) and the primary identifying bits (- or %ul or .class) are at the far left of each line, I can generally read things more quickly and more easily than e.g. straight HTML or ERB's <%= %>. But that comes from rather extended use, I'm definitely not claiming it's the best. There are plenty of things I dislike about HAML, but it does mean I read less, and I spend quite a bit of time reading and writing view code. Mind if I ask if you've done PHP programming? If you have, ERB's <% would seem to be a tax you've already paid.
- nahname 14y agoI am from a dotnet background originally, only created one php app back in my school days. For me, it is less about liking ERB and more about preferring the medium I am working in (HTML). If I could pick anything, it would be razor. It is similar to ERB in that you use HTML, but the painful percent brackets are replaced by a single @. Code blocks are as follows: @{ // code } another example: <div>@user.Name</div> It feels very natural to write and is simple to read/pickup. Now that microsoft has open sourced it, someone should make a version in ruby. Might be a good side project for me actually :)
- rhizome 14y ago<%= content_tag :div, "some text", class: 'foo', html: attrs %> to keep it consistent with your haml example
- kjell 14y agohttps://github.com/stonean/slim#benchmarks https://github.com/stonean/slim#benchmarks Slim is mentioned in the writeup. It's faster than Haml. I like it better.