velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Mason <and...@assertis.co.uk>
Subject Re: [ANN] Viento - WHY?
Date Fri, 07 Oct 2005 16:35:36 GMT
Just on that note, I've got a designer who is not very technical . He has 
absolutely no trouble with velocity syntax what so ever. It has taken all of 
a day for him to learn, and he's now able to do some reasonably advanced 
stuff with his templates. Now i'm not saying other templating tools aren't 
good, but velocity's syntax is one of its most powerful features. 




On Fri October 7 2005 5:28 pm, jian chen wrote:
> Hi,
>
> I have been looking at the FreeMarker vs. Velocity emails. The only
> objection that I don't use FreeMarker in my project is, I prefer the
> Velocity syntax to FreeMarker. I like a clear separation of the template
> code from the HTML.
>
> Just my 2 cents,
>
> Cheers,
>
> Jian
>
> On 10/7/05, Jonathan Revusky <revusky@wanadoo.es> wrote:
> > Malcolm Edgar wrote:
> > > All good stuff..
> > >
> > > FreeMaker is pretty cool, however I ended up using Velocity because of
> >
> > its
> >
> > > simplicity and because the Velocity directives don't look like
> > > xml/html:
> > >
> > > http://click.sourceforge.net/docs/faq.html#why-velocity
> >
> > Well, you're certainly free to opt for whatever tools you like. Also,
> > the existence of FreeMarker, even if you choose not to use it (for now
> > at least :-)) only gives you more options. (Also, FM's existence and
> > continued development puts some pressure on the Velocity developers to
> > get their act together, which benefits you and other Velocity users.)
> >
> > Anyway, as regards your link above, I had come across that in various
> > web surfing/googling and had a few comments that I intended to make, but
> > never got around to it.
> >
> > In the above linked page, you point out (correctly) that FreeMarker
> > clearly has better error reporting than Velocity. (For example, this was
> > one of the reasons cited by the Webwork people for their migration.)
> > However, you then provide examples of how your Click framework mitigates
> > that.
> >
> > You provide a link to the following error page provided by your
> > framework.
> >
> > http://click.sourceforge.net/docs/error-npe.html
> >
> > Now, I think this kind of does beg the question a bit. Most of the time
> > you have a null pointer sort of problem in the template engine space is
> > when somebody misspells the name of a variable in some way. They write:
> >
> > ${user.first_name}
> >
> > when it should be:
> >
> > ${user.firstName}
> >
> > or vice versa or whatever. And in general, people are not very good
> > spellers for the most part and it's very easy to make such mistakes.
> >
> > But when somebody on the template level makes such a mistake, what good
> > does it do that person to get a java stack trace? Surely what they need
> > is the line number location in the template file where the mistake was
> > made.
> >
> > Software is built in many layers and people are typically working on a
> > given layer and other people on another layer, and thus, a division of
> > labor is achieved.
> >
> > By analogy, if I try to reference a null in java code, but get a stack
> > trace showing me where the problem was triggered in the underlying C
> > code in the JVM, how useful would this be for me as a java programmer
> > working on that layer? I am working at one layer (the java code) and it
> > is giving me an error message wrt another, lower layer (the C code in
> > the JVM.)
> >
> > Surely you see my point, right? Meanwhile, by way of contrast to the
> > error page from Click that you show above, here is what a similar error
> > message from FreeMarker outputs:
> >
> > Expression foobar is undefined on line 2, column 3 in bar.ftl.
> > The problematic instruction:
> > ----------
> > ==> ${foobar} [on line 2, column 1 in bar.ftl]
> > in include "bar.ftl" [on line 2, column 1 in foo.ftl]
> > ----------
> >
> > Java backtrace for programmers:
> > ----------
> > freemarker.core.InvalidReferenceException: Expression foobar is
> > undefined on line 2, column 3 in bar.ftl.
> > at
> > freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
> > at freemarker.core.Expression.getStringValue(Expression.java:118)
> > at freemarker.core.Expression.getStringValue(Expression.java:93)
> > at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
> > at freemarker.core.Environment.visit(Environment.java:196)
> > at freemarker.core.MixedContent.accept(MixedContent.java:92)
> > at freemarker.core.Environment.visit(Environment.java:196)
> > at freemarker.core.Environment.include(Environment.java:1365)
> > at freemarker.core.Include.accept(Include.java:155)
> > at freemarker.core.Environment.visit(Environment.java:196)
> > at freemarker.core.MixedContent.accept(MixedContent.java:92)
> > at freemarker.core.Environment.visit(Environment.java:196)
> > at freemarker.core.Environment.process(Environment.java:176)
> > at freemarker.template.Template.process(Template.java:231)
> > <etcetera>
> >
> >
> > You see my point, I'm sure. The error message tells the template writer
> > where the error occurred *at the level he or she is working at*, i.e.
> > the line/column information in the template file. (And, of course, it
> > does provide the java stack trace that could be copy/pasted in an email
> > to the java developers, if necessary.)
> >
> > Now, I grant that using your framework probably does offer substantial
> > advantages over using Velocity alone -- in this and other regards.
> > However, to imply that it fully addresses the error reporting problems
> > inherent in Velocity (as compared to FreeMarker) is clearly incorrect.
> >
> > Since you did basically bring this up by pointing to this link, I think
> > it is only proper that I should point this out.
> >
> > Regards,
> >
> > Jonathan Revusky
> > --
> > lead developer, FreeMarker project, http://freemarker.org/
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: velocity-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Mime
View raw message