[Helma-dev] Re: Helma Templating

Andreas Bolka andreas.bolka at gmx.net
Thu Dec 1 22:27:49 CET 2005


As Juerg's brilliant work on integrating FreeMarker/Velocity stirred a
lot of interest, I want to express a few personal thoughts, basically
I only expand on Hannes mention of .hsp's: "it's a good thing we went
over that".

I always enjoyed (non-hsp-)Helma's extremely strict separation between
code and presentation -- when you want to write code, you have to
write a macro. There is no second programming language [1] that can be
used in skins. Calls to macros are the only way to go. Fullstop. [read
on after Juerg's example]

Wednesday, November 30, 2005, 1:28:08 AM, Juerg wrote:

> How would I for example write the following FreeMarker example in
> Helma 2.0:

> <table>
>         <#list param.topics as topic>
>         <tr class="topic">
>                 <td>
>                 <#assign count = topic.comments.count() - 1>
>                 <#if count != 0>
>                         <#if count = 1>
>                                 1 Comment
>                         <#else>
>                                 ${ count } Comments
>                         </#if>
>                 </#if>
>                 </td>
>         </tr>
>         </#list>
> </table>

And my dislike for constructs such as this FreeMarker template is
exactly why I like Helma's strict seperation that much. In Helma-land:
No second language, no ugly clutter of templates with what is
definitely logic/code. Presentation code stays in macros. I don't have
to decide if I should write an <#if></#if> or an if{}. And I therefore
can't make a "wrong" decision (i.e. violating aesthetics or coding
standards).

Now we all know that Helma's strict seperation results in a
proliferation of (often very small) .skin files. In the example above
we would maybe have 'noComments', 'oneComment' and 'manyComments'
skins. That this proliferation becomes cumbersome quickly, is obvious
(if not, just imagine you want to change the spelling of "Comments"
from uppercase to lowercase). So what's needed in my eyes, is
something to help in situations with such micro-/sub-skins.

That's why I liked the outcomes of February's discussion on
"internationalization" a lot, especially the scheme Hannes hinted at
in http://helma.org/pipermail/helma-dev/2005-February/001696.html
(bottom half). Matthias wrote later in this thread: "i'm excited :)" -
so was I. And I still think, that exploring this direction further
would be very exciting and valuable. I think I'd like this a lot more
than all this PHP-ish code/template messup.





[1]: I state "no second language" as a fact, even though I don't deny
that considerations of when a set of macros becomes a programming
language on it's own have their (philosophical) value. Also note that
FreeMarker's templating language is Turing-complete.

-- 
Best regards,
 Andreas                            mailto:andreas.bolka at gmx.net




More information about the Helma-dev mailing list