[web-devel] Re: Hamlet & Haml

Michael Snoyman michael at snoyman.com
Sun Apr 18 01:04:49 EDT 2010

On Sat, Apr 17, 2010 at 10:52 AM, James Britt <james at neurogami.com> wrote:

> John Bender wrote:
>>  Notably in your rant you site static indentation and "most forms" of
>> static typing as "solving problems that don't come up in real life code".
>> Haskell would seem to be an interesting choice for your development efforts
>> in both cases then no? ;)
> Oh, yes. :)
> I think if Haml, Yaml, and other hard-line indentation formats used
> Haskell's off-side rule I'd find them easier to work with.
> Haml, for example, demands a very specific indentation; off by one extra
> space and you get slapped, even if visually it is quite clear what is going
> on.  It makes for extra work for me.
> The offside rule for Haskell also seems to make more sense in the context
> of function equations (e.g. this-side = that-side).
> Having Haskell tell me "Think of this code as a set of equations" makes
> sense.  Haml's "Think of your essay document with embedded metadata as a
> rigid hierarchy of nodes" feels forced.
> I'm sorry, I'm not familiar enough with the indentation rules you're
referring to; could you explain it more throughly? This might be a case
where I accidentally solved a problem ;).

>> I think you make a fine point about xhtml being a great tool, but if you
>> plan to embed some form of syntax into your templates and avoid data binding
>> Haml is one of the better solutions out there.
> Almost all of the Haml I've had to deal with is used in Rails projects, and
> data binding and embedded code is all over the place.  Sort of the worst of
> both worlds. :)  (And I find it harder to fix other people's code when it's
> in Haml.  Haml seems to favor writing over re-writing. But I'm ranting
> again.)
> I don't mind mixing code in with templates, I'd much prefer I be given the
> choice as to when that is appropriate.   I just try to avoid it since it
> makes things harder in the long run.  But for knocking something out just to
> explore an idea it's great.
> For example, I used to do JSP and ASP development, and I could write large
> chunks of code  inline the page markup to see if something was a useful
> path.  If so, I would then refactor the code out of the markup up and bundle
> it up in something faster/cleaner/easier to test.  But with everything in
> the page I could refresh the browser and see my results and avoid having to
> run the compiler, etc.
> The risk, though, is that being undisciplined can lead to the stereotypical
> worst-case PHP kind of code.
> James
> _______________________________________________
> web-devel mailing list
> web-devel at haskell.org
> http://www.haskell.org/mailman/listinfo/web-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/web-devel/attachments/20100418/fd9b5f23/attachment.html

More information about the web-devel mailing list