1. Velocity 1.5-dev does actually it does show you where it fails:http://click.sourceforge.net/docs/error-parsing.html2.
Regarding point 1 above, is it really appropriate to compare Velocity 1.5 beta code with the current stable production version of FreeMarker? The features that Max is talking about in FreeMarker have been part of our stable/production version for well over 3 years(!)
Moreover, while Velocity 1.5 beta is surely some improvement over the current stable version, it does not catch up with functionality that has been present in FreeMarker for the past 3 years at least. In fact, I recently came upon a wiki page that describes a roadmap for Velocity releases. As far as I can tell, there is, to all intents and purposes, nothing on Velocity 2.0 wishlist that is not already implemented in the stable production version of FreeMarker. You can see:
http://wiki.apache.org/jakarta-velocity/RoadMapEven if all the points on Velocity 2.0 roadmap (support for JSP taglibs, sensible whitespace handling, macros with bodies....) were to be implemented, it might be approximately competitive with FreeMarker's current stable feature set.
All of this does have certain clear implications IMO. FreeMarker is still a fairly well known project in the java/web world. So this is a codebase that has been subjected to the stresses of real-world usage in a large number of projects out there. It is very well tested.
Now, I am obviously biased, but given this, I am puzzled as to why anybody looking for this kind of tool should opt for Velocity 1.5 beta over FreeMarker 2.3 stable?
Well the point was Velocity is easier to learn.
As for your this point, that Velocity is easier to learn, this just strikes me as false. FreeMarker does not offer a steeper learning curve to a new user. To learn to use FreeMarker to do the same things that you do with Velocity is no harder.
Granted, FreeMarker is a more powerful, full-featured tool. But that just means that the extra power is there when you need it. If you never need to use a JSP taglib, FM's support for taglibs does not cause any steeper learning curve on the user. The same is the case of the XML processing functionality and so on. It's there when you need it, but it does not impose a steeper learning curve on new users.
Point 2 is just false.
3. I have tried the new FM [/] syntax is HTML pages, and its still pretty ugly. Its better than jsp xml style markup, but is very heavy.regards Malcolm Edgar
As far as I can tell, point 3 is also false basically. I don't mean the statement that the syntax is ugly, since that is purely subjective and doesn't fall within truth/falsity, but the statement about the syntax being "very heavy".
Concretely, let's compare certain constructs in VTL (Velocity template language) with FTL (FreeMarker template language).
Straight assignment. In FTL:
[#assign x=3]
In VTL:
#set ($x=3)
Here, I grant that the VTL is 2 characters shorter than the FTL. However, this is not because of the logic and structure of the syntax, but because we are using a longer keyword 'assign' vs. 'set'. If we allowed 'set' as a synonym for 'assign' (Maybe we should...) then the FTL syntax would be one character shorter. (This is because we don't need the $.
Consider an if statement. In FTL:
[#if name = "Joe"]
...
[/#if]
In VTL, we have:
#if ($name == "Joe")
...
#end
In this case, the VTL and FTL constructs are exactly the same length. However, I think the FTL has a clear advantage over the VTL, which is that it clearly distinguishes the end of an if directive over another sort of directive, where VTL always uses the same closing tag of #end. FTL is the same length, but has a tangible readability advantage.
Now, let's consider a loop:
In FTL, we have:
[#list users as user]
...
[/#list]
In VTL, we have:
#foreach ($user in $users)
...
#end
This time, the VTL construct is actually one character longer. 30 characters vs. 29. This is because of the need for the $ characters within the parentheses when FTL avoids that visual clutter.
Now, it's true that in VTL you can write:
$foo
vs.
${foo}
However, this is an ambiguous advantage, particularly wrt point 2, learnability, since it provides 2 different ways of writing the same thing. FM is consistent in requiring ${...}.
As for the aesthetics, that the FTL snippets above are "ugly" and the VTL snippets presumably are not, that is not within the range of objective analysis really. I defer to the reader the judgment as to whether the above is a valid argument in favor of Velocity over FreeMarker.
Anyway, Malcolm, this stuff about FM's syntax being "very heavy" (presumably in comparison with VTL) does not stand up to any real scrutiny. I really believe that a fair-minded objective review of this issue (not from me of course, I'm not objective) would come to the conclusion that there is no significant difference in notational convenience between the two tools.
Regards,
Jonathan Revusky
--
lead developer, FreeMarker project,
http://freemarker.org/