velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Pettiss <>
Subject Re: [ANN] Viento - WHY?
Date Sun, 09 Oct 2005 05:23:52 GMT
Syntax highlighting isn't very flexible in many popular editors, and 
often the HTML-specific ones will not allow you to color <...> 
differently from <#...>.  Some potential users might have trouble 
choosing colors for their MSN... your blithe hand-waving about proper 
use of syntax highlighting will get you glazed eyeballs at best.

Also what of this:

<td <#if item.imagetype = "big">colspan="2"</#if>>
<span style="font-family:Helvetica,sans-serif;
    <#if = "limited">color:#cc9933;
    <#elseif = "new">color:#eeff00;</#if>">
<#if item.selected><b <#if 
${}<#if item.selected></b></#if>

How exactly is this going to look with syntax highlighting, given that 
HTML and FTL are nested within each other, and-- nested within quoting, 
which vexes even the best editors...

Also note the $ which usually indicates to the user, a variable, is 
missing from inside the directives, which makes the directives 
"disappear" even more. 

Finally note that the need to both open and close each opening and 
closing directive with the same opening and closing delimiters used by 
HTML is really fricking confusing, and downright annoying to have to type!

I don't really like having to type < and >.  I think the choice to allow 
[ and ] is a good one.  But I much prefer this, due to the other reasons 
listed above:

<td #if( $item.ImageType == "big" )colspan="2"#end>
<span style="font-family:Helvetica,sans-serif;
    #if( $item.Sale == 'limited' )color:#cc9933;
    #elseif( $item.Sale == 'new' )color:#eeff00;#end">
#if( $item.Selected )<b #if( $item.Current 
${item.Name}#if( $item.Selected )</b>#end


Jonathan Revusky wrote:

> Chad Meadows wrote:
>> The analogy is not accurate.
> Okay, analogies, by their nature are not "accurate". "Life is like a 
> box of chocolates..." and so on. My point was really just that it is 
> surprising that someone who primarily knows HTML or XML would find 
> FreeMarker's pseudo-tag approach unpalatable. The basic *approach* of 
> a FreeMarker if statement, say, is familiar to such a person:
> <#if user.isLoggedIn>
>   ...
> </#if>
> After all, it's an approach that they are used to, bounding things 
> with <foo>...</foo>. And this could make for more initial comfort 
> level than another, completely unfamiliar syntax.
> And this is the same mechanism that makes Java initially more 
> palatable to a C hacker than Smalltalk, say. That was my point.
>>  If Java was written by interweaving it within a C program this would 
>> be an accurate analogy.  In which case, I would suspect everyone 
>> would then consider that a syntax nightmare.
> Well, okay, this is stretching the analogy further than I would have 
> intended. It's all apples and oranges. Java is note a templating 
> language. But fine, mea culpa, the analogy is obviously quite imperfect.
> So, let's not work that analogy further. Let me take another tack on 
> this topic....
> Okay? Here goes....
> Chad, this whole idea being bandied about, that people working on 
> FreeMarker page templates have a problem distinguishing the FreeMarker 
> directives from the HTML tags is, to the best of my knowledge, a 
> complete and utter non-issue.
> I just realized that I have now been involved with FreeMarker for 6 
> years, first simply as a user (which is the period in which I actually 
> interacted most with designers who were using FM templates) and then 
> later as a developer, and eventually, as project lead, rewriting the 
> parser/renderer core of the engine for the 2.x releases.
> In all of that time, I have never heard somebody who actually uses 
> FreeMarker complain that they confuse the FreeMarker instructions with 
> HTML tags -- that this is a problem. I believe you could google on our 
> mailing list archives and the list archives of high profile projects 
> that use FreeMarker as a view (like OfBiz and now, Webwork) and you 
> will simply not see anybody complaining about this. (They may have 
> other FreeMarker-related issues, sure, but not this one.)
> I grant now, that this is not 100% absolute proof that this is not a 
> real-world problem. However, I can only go by what evidence I have. 
> Don't you think that, if this really were a widespread problem, that, 
> in 6 years, it would have come to my attention?
> Now, what is interesting is that, people have lobbied for an 
> alternative syntax that didn't delimit with <...>. And the latest 
> version in CVS (and soon to be released) allows [#...] as an 
> alternative to <#....>.
> BUT if you look at the messages where people lobbied for this, there 
> was never any mention of human template writers being confused by the 
> syntax. It was entirely to make the templates compatible with certain 
> tools -- for example, HTML-oriented editing tools that got confused by 
> pseudo-tags.
> IOW, the syntactical issue has come up, but it was always because the 
> syntax confused certain tools -- never, to my recollection that it 
> confused people. I reason that if that had been an issue, this would 
> have also come out in such conversations. It never did.
> But, you don't really have to take my word for this, Chad. Nor should 
> you -- at least, if this still is a major concern of yours wrt 
> FreeMarker. If you are at IBM and have web page designers on staff, 
> see if you can have one or more of them work with FreeMarker on a 
> pilot project for a certain period of time and see whether there 
> really is a problem of people confusing FreeMarker directives with 
> HTML or XML tags.
> I will re-iterate that FreeMarker tags all start with quite 
> distinctive character sequences:
> <#
> and
> <@
> that are not valid XML/HTML anyway. These patterns can be syntax 
> highlighted in a separate color. (And of course, they should be.)
> Now, if there is real solid evidence that this is a genuine problem, 
> that people still get all dazed and confused because they can't 
> distinguish a FM directive from an HTML tag, like *even* if you 
> syntax-highlight HTML tags in orange and FTL in purple, I will be very 
> interested in hearing about this.
> But, really, you must understand that, until then, given the data that 
> I have on this question, it just does not seem like a fruitful line of 
> inquiry or discussion. It seems utterly sterile because it simply does 
> not appear that this is a real-world problem.
> Regards,
> Jonathan Revusky
> -- 
> lead developer, FreeMarker project,
>> Chad.
>> Austin Taylor <> 10/08/2005 05:14 PM
>> Please respond to
>> "Velocity Users List"
>> To
>> Velocity Users List <>
>> cc
>> Subject
>> Re: [ANN] Viento - WHY?
>> Jonathan, you really are coming across as polemic. Try to be more
>> contemplative (like maybe you actually considered the other person's 
>> point
>> of view) than defensive.
>> Well, in other contexts, such things have been deemed to be an
>>> advantage. Java syntax was based on that of C to make it more palatable
>>> to all the existing C hackers. Java, in fact, looks like C but is 
>>> not C.
>>> Most people would guess that this strategy did work, in fact. So, 
>>> why is
>>> this case so different? If FTL looks like HTML but is not HTML, why 
>>> does
>>> this lead HTML hackers to reject it, yet when Java looks like C but is
>>> not C this would tend to enhance Java's acceptability?
>> That's a very interesting point. I suppose, for HTML people, 
>> FreeMarker's
>> syntax might be great. As a programmer, I prefer something that feels 
>> more
>> like a 'real' programming language. The syntax in Viento is designed 
>> to be
>> like Java, with a little sugar from Ruby to make it worthwhile, and a 
>> few $
>> from perl to make it a template language.
>> Austin
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message