Jeromy Evans wrote:
Niall Pemberton wrote:
I just saw the following comment

"FreeMarker is very similar to Velocity, as both are template
languages that can be used outside of a Servlet container. The
framework utilizes FreeMarker because FreeMarker has better error
reporting. However, both are good alternatives to JSP."



I've questioned that a few times myself. The paragraph doesn't do FreeMarker much justice from a technical sense, but then again, most Struts 2 users won't exploit the features FreeMarker offers above Velocity,

What is your basis for thinking this? It's clear enough from the freemarker-user list that people do use advanced features of the tool that are not in Velocity. I just don't see offhand why the usage patterns of people using FreeMarker in conjunction with Struts 2 would be particularly different from users in general.

Though, the other thing is that, even if the assertion were true, I don't know how you would know it was... it seems like a seat of the pants conjecture...

it has a much steeper learning curve,

Not really. FreeMarker has a longer learning curve because there is simply more to learn to fully master what it has to offer. It's not steeper AFAICS. To learn how to do the same basic things in FreeMarker, that you can do with Velocity, from "Hello, world" on up is not a steeper path. Again, if you want to take advantage of everything the tool has to offer, you have a longer path in front of you, but it's not steeper, I don't think.

it's not as broadly supported by IDE's

There is very little IDE support for either Velocity or FreeMarker. If you are bringing JSP into the comparison, then you have a point, but the topic at hand was FreeMarker vs.Velocity.

There is probably a better chance at this point that FreeMarker will eventually have more third-party tooling support, because FM 2.4 will contain a new tools-oriented API that will make it much easier for tool writers support FTL. Of course, Velocity is, to all intents and purposes, a dead project development-wise, so I don't think any such tools API is forthcoming.

The other reason that we could expect more on this front for freemarker is that the newer versions of Netbeans replaced their use of Velocity with FreeMarker, and it is likely that they will provide some support for editing FTL's. (There is some preliminary stuff available, but I haven't looked at it.) Of course, I would suppose that if one of the big IDE's eventually offers this feature, their competitors will seriously consider it as well. Admittedly, when and if this really will come on line, I have no idea.


and the syntax doesn't transfer easily to other domains (ie.it's rare to find a interface designer that can read an html FreeMarker template, but most can grasp the syntax of a velocity template within a few moments).

I have heard this claim made before, but I have never lent much credence to it, simply because, intuitively, it would be very surprising to me that an interface designer can learn Velocity but be unable to learn FreeMarker. The assertion just does not ring true to me. OTOH, if there was serious empirical evidence that showed this, I would have to change my tune. But over the last 5 or 6 years, very many people have switched from using Velocity to FreeMarker. Our user list is full of Velocity refugees. I have never heard anybody say that non-programmers had a harder time reading a FreeMarker template than a Velocity one. I grant that it could be true, but it does not seem to be much of an issue in practice.

FreeMarker is technically superior in (almost?) every way, but not always appropriate.

I have heard this before, but I cannot conceive of a usage scenario in
which Velocity would be indicated over FreeMarker. In terms of JSP, that has the obvious advantages associated with being a standard, greater tool support, more people out there who already know it. That said, there are plenty of people who prefer FreeMarker. The reasons vary, but I think they just find that it's a a lot cleaner... conceptually, I guess. As for things like JRuby or Groovy results, I think that is something so different that a direct comparison with FreeMarker or Velocity doesn't make much sense.


We should link to/provide something that helps users decide what best suits their circumstances,

Anything you link to would be just somebody else's opinion. There is no
reason that you could not offer your own opinion. I'd infer that you don't want to point out there that a fellow ASF project is abjectly inferior, so, okay, you provide a link where some 3rd party says it, but you know.... ;-)

including the argument for and against JSP. I don't think there will ever consensus to recommend one.

I think that in terms of FreeMarker vs. Velocity, there is a pretty strong consensus among technically informed people in favor of FreeMarker. As for JSP or other things, like XSLT maybe, or Groovy or JRuby, they aren't directly comparable in the same way that FreeMarker and Velocity are.

At the same time it may be useful to compare these to why a JRuby-based or Grails-based action/result may be more suitable. Blog anyone?

Well, again, you're bringing in things that aren't directly comparable in the way that FreeMarker and Velocity are. And that was the topic at hand. Limited to those two things, the case for FreeMarker is just devastating, I think. It is not an objective source obviously, but I think the following covers the points:

http://freemarker.blogspot.com/2007/12/velocity-of-freemarker-looking-at-5.html

And it's not unfair to link it, I suppose, because if the Velocity people cared to write a rebuttal, they have the right to, and you could link that as well. That blog article contains links to some other blog articles detailing a switch from Velocity to FreeMarker.

http://in.relation.to/Bloggers/AStoryAboutFreeMarkerAndVelocity
http://blog.nominet.org.uk/tech/2005/06/29/moving-from-velocity-to-freemarker
http://blogs.sun.com/satya/entry/migrate_to_freemarker_from_velocity

Of course, you could say that the above ones are cherry picked to support the case for FreeMarker. But actually, go look for similar blog articles about a move in the opposite direction. You'll come up empty handed, I dare say.

Oh, and as for FreeMarker vs. JSP, Jive Software, whose flagship product is built on Webwork 2 and FreeMarker, switched from JSP to FreeMarker. Here is some discussion by the Jive developers on that.

http://article.gmane.org/gmane.comp.web.freemarker.user/2984
http://www.jivesoftware.com/community/blogs/clearspace/2007/07/20/the-switch-to-freemarker

Note the last point Bruce made there on our mailing list: "It's powerful enough for our needs -- velocity didn't have the features we required." This does seem to contradict the idea that Struts 2 users would not need the extra power that FreeMarker offers. Just one data point admittedly, but it tells you something.

Well, 'nuff said, I guess. In some private conversation, one of my collaborators on FreeMarker pointed to the quote above on your site about FreeMarker vs. Velocity and, you know, basically said that it was highly annoying... there's a strong sense out there (right or wrong) that something like this is an example of you bending over backwards to be charitable to a fellow ASF project. I had seen that page before and that was my impression as well. I dunno... Do what you want, but I don't think you're doing anybody any favors by holding back on telling the unvarnished truth about this kind of thing. I don't think that it's even a favor to the Velocity community, though, you know, if some of the blogs I have linked never shook them out of their complacency, I don't know what would... :-)

Regards,

Jonathan Revusky
--
lead developer, FreeMarker project, http://freemarker.org/


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to