Rails developers: Do you use HAML?

Calamari

Veteran XV
We inherited a project that uses HAML instead of erb for its views, and I'm on the fence about it.

On the one hand, I hate some of the restrictions it puts on making your code easier to read (can't line break really long echo statements, for instance). On the other hand, it is a significantly smaller amount of code.

I've got some other projects coming up, and I'm trying to decide whether or not to stick with ERB, and or them in HAML. Figured I would see what other devs had to say. FYI: these projects are going to be handed off to other people, otherwise I would just screw around in HAML for the hell of it.

On a side note, we use SASS here in both Rails and Django projects, and I love the hell out of it.
 
Switch to HAML. The significantly smaller amount of code outweighs any downside (your listed one seems trivial imo, shouldn't have extremely long lines of code in view...)

I am on a php project now, and HAML/SASS is the biggest thing I miss, there is no template engine that comes even close. My development time on front-end shit is like 3x what it used to be.

Also HAML is probably more standard than erb among good rails developers. Everyone loves it, it may even go in my default in some later release.
 
Switch to HAML. The significantly smaller amount of code outweighs any downside (your listed one seems trivial imo, shouldn't have extremely long lines of code in view...)

I am on a php project now, and HAML/SASS is the biggest thing I miss, there is no template engine that comes even close. My development time on front-end shit is like 3x what it used to be.

Also HAML is probably more standard than erb among good rails developers. Everyone loves it, it may even go in my default in some later release.

When I say long lines of code, I mean stuff like:
Code:
= link_to image_tag("image-name.jpg, :alt => "alt"), path_to_delete_item(@item), :confirm => "Confirm Message", :method => :delete, :title => "Title"

But I also have issues with things like:
Code:
%p
  Putting some text here, but I need a 
  = @variable
  here.

I could nest that all like "this #{@variable}", but that seems pretty inefficient, unless I'm missing something.
 
Ah I see, yeah the long line thing is unavoidable. Could use helpers if it applies.

For the second one, yeah the workaround would be to put it in quotes. Which I don't think is any less efficient in terms of computational time. I could definitely be wrong though.
 
Back
Top