When I first read this discussion it sounded great. The more I look at
it, the less I like it. One of the things that attracted me to HAML is
that it is a pretty clean abstraction on top of html/xmhml. Its not so
much about introducing new abstractions like creating a "grid" tag or
a special labeled text tag, but just taking plain ole html/xhtml and
beautifying it. I realize this suggestion isn't quite like creating a
new special tag, but it does seem like it leads down the path of
creating special abstractions. I realize we already have the special
case of "." and "#" and their relationship with div. But, if you had
to pick one tag to make the default, it does makes sense. Making the
default tag be context specific changes this thought from just being
the "default" tag to being a haml abstraction that I'm not sure will
be good in the long run.

HAML, isn't so much about introducing "new" abstractions, but making
what you are doing already more beautiful, terse and easier to read.
For the most part, you use the exact same html/xhtml tags, but hamlize
them. This makes haml 1) very easy to learn, 2) extremely productive
to work with, and 3) always a pleasure to read. I think this
suggestion, might help #2 in some cases and make you slightly more
productive for the microsecond that you are typing that tag inside a
ul, tr, etc., but in the long run hurt 1 and 3.


On Mar 6, 5:48 pm, "Mislav Marohnić" <[EMAIL PROTECTED]>
wrote:
> On Wed, Mar 5, 2008 at 9:32 PM, Hampton <[EMAIL PROTECTED]> wrote:
>
> > * If you are debugging, your first step will have to be View Source
> > since you will be unaware of what is being created. Your first
> > instinct is "holy crap it must not be doing the right thing". This
> > slows you down.
>
> I agree with this 100%.
>
> > * Nesting partials gets trick, trick, tricky. I can think of many
> > complex examples where tracking this would be a fucking pain.
>
> Well, I never even thought of tracking it across nested templates. It would
> be hard to implement, I guess.
>
> > The only thing I'd consider for "official" syntax is a "GUESS" command.
>
> > %table
> >  ?
> >    ?.name
> >      Data
> >    ?.value
> >      Data
>
> I like having the "guess" character since it would allow me to build nodes
> without specifying a classname or ID. I never thought of this. I dislike
> using the "?" character, however. I would much rather use asterisk or
> dollar.
>
> %table
>   *
>     *.name Mislav
>     *.age 24
>
> What do you think? Is there a character more appropriate?
>
> Regarding other people disliking this because of "magic": I agree. Giving
> people this behavior is not necessarily giving them power; it can also take
> away power (as Hampton said) and lead to some debugging sessions. Jeff
> Casimir demonstrated this: he thought that SPAN will be generated inside the
> LI, but in fact DIV is generated. While this can educate people on HTML (as
> Eric noted), it can also be frustrating.
>
> Explicitness in programming is not always bad; quite the opposite. In Haml
> templates it leads to readability, which is good. I came up with this idea
> because I wanted to sacrifice explicitness for ease of typing, but maybe the
> trade-off isn't fair. But, because I learned HTML directly from the spec and
> its DTD, I know all the nesting rules by heart and therefore I benefit from
> this "magic". Other developers who never read the DTD may not benefit in the
> same way and will feel uneasy about using the syntax because they will not
> be sure what's being generated.
>
> I don't want to kill off my baby, however. Neither does Hampton or Nathan,
> as they expressed it openly. I'll keep my "html" branch alive and try to
> actually use it, see if I hit some negative consequences with this. Maybe
> I'll also release this as an evil twin plugin for Haml, it is very easy to
> monkeypatch in core Haml.
>
> You are free to pull my branch and play with it. Thanks for all the comments
> and praises.
>
> So how does the community feel about the "guess" syntax (middle of this
> email)? It has more chance of becoming core.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to