This is some forwarded/edited email of a private discussion that I'm having
with some people about Tea vs. WM. I personally think that this is good for
all of you to see as well.

-jon

----------

Jon S. says (in response to Tea being harder to screw with than WM):

The only objects you have access to are the ones that either the WebContext
provides you or the objects that have been placed into the WebContext
itself. Thus, they are not "random" at all because someone has to physically
put them there.

As far as passing data into those methods, I see that as a good thing. For
example, you could have a SelectBox object that has been placed into the
context. This object has been populated with values to build up a <select>
HTML element. In WM, all you then need to do is something like this:

<tr>
    <td>
        $selectBox.setSize(2).setMultiple(true).setName("myBox")
    </td>
</tr>

The .toString() output of that is something like this:

<select name="myBox" size=2 multiple>
    <option value="foo" selected>foo
    <option value="bar">bar
</select>

Note that the object is generating the HTML with ECS in this case since it
is very specific and there isn't need for the designer to have control over
the generation of the html, only the generation of the html object itself.
Also note that the designer didn't have to worry about whether or not the
<option> tag had something selected or not. All he/she cares about is the
placement of the $selectBox in the template and the look and feel portions
that generate the object (such as setMultiple and setSize and setName)

To me, that is perfect abstraction.

I personally think that a lot of people are turned off to WM because it
doesn't already have a library of this helper code written and available
with the WM distribution. It would be like having the Java language without
all the classes available to it. Note that the Turbine project is trying to
at least provide a framework of this type of helper code.

> The Tea
> language has been created to be more limiting.  GO.com has found that
> this improves the separation, and allows them to have templates authored
> by "technical producers" instead of programmers, because the language is
> simple and the producers absolutely can't screw things up even
> accidentally.  :-)

I really don't understand how this statement is any more true than with WM.

If the page doesn't render properly, it is "screwed up", right? With that
logic, I bet you that I can find a trained monkey to screw a page up using
Tea as easily as he/she could screw a page up using WM. :-)

I really think that you are not giving WM enough credit. It is equal to Tea
in abilities, the only real important difference to me between Tea and WM is
that Tea syntax is more like JSP and WM is its own syntax. So, if you are on
a "compliance" bandwagon and you want something "better than JSP, but
similar enough to seem compliant, then Tea is your solution". :-)

If you want a very strong MVC solution, then WM is for you as there are
things in Tea that, to me, allow a bit to much control logic in your
template (ie: the call statement and the fact that code is interpreted
within the blocks (see below)). Tea simply allows you to put way to much
logic into your pages and from experience, we have learned that this is a
"Bad Thing (tm)". :-)

Here is an example of Tea vs. WM:

    Tea:
    <%
    if (color != null)
    {
        '<body bgcolor="' & color & '">'
    }
    else
    {
        '<body>'
    }
    %>

    WM:

    #if ($color)
    {
        <body bgcolor="$color">
    }
    #else
    {
        <body>
    }

The syntax in Tea is the same mistake that PHP has made. You have to treat
HTML within the code as a special string type. That is bad because it is the
same as embedding html within your code (I bet it is more confusing for HTML
designers typing "&" to concatenate strings than not having to type it at
all). It gets worse when you have more complicated examples.

On top of it,  there are people out there that like to see how their
templates will render directly opened in browser. WM code will show up much
nicer than Tea code (which will just disappear). Don't even get me started
with having to type <% %> all the time. Anyone who has worked in WM long
enough will understand that. :-)

-jon





------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to