<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-22457957</id><updated>2024-08-28T18:08:23.310+02:00</updated><title type='text'>FreeMarker Blog</title><subtitle type='html'>The official weblog of the FreeMarker project</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://freemarker.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default?alt=atom'/><link rel='alternate' type='text/html' href='http://freemarker.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Attila Szegedi</name><uri>http://www.blogger.com/profile/11586966395114113526</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>21</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-22457957.post-2919726442930351484</id><published>2010-02-16T11:07:00.001+01:00</published><updated>2010-02-16T11:08:54.894+01:00</updated><title type='text'>FreeMarker is on Twitter</title><content type='html'>Did you know you can follow &lt;a href=&quot;http://twitter.com/freemarker&quot;&gt;FreeMarker project on Twitter&lt;/a&gt;?</content><link rel='replies' type='application/atom+xml' href='http://freemarker.blogspot.com/feeds/2919726442930351484/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/22457957/2919726442930351484' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/2919726442930351484'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/2919726442930351484'/><link rel='alternate' type='text/html' href='http://freemarker.blogspot.com/2010/02/freemarker-is-on-twitter.html' title='FreeMarker is on Twitter'/><author><name>Attila Szegedi</name><uri>http://www.blogger.com/profile/08179252447170860637</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWwxGUh32u_2eeSs3KazexD2seNWQlQR7QNwOnD3CrHpF7EeV8QMV4Hl10YbMp1ibrLccXyTGsjFXkWMSnKQg0swFSbfxDUppNAapgk6h5sllMGNEH956O5-6xQWvlQrs/s220/face.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22457957.post-5043543105561444350</id><published>2010-02-14T11:39:00.006+01:00</published><updated>2010-05-04T09:12:55.405+02:00</updated><title type='text'>FreeMarker on Google App Engine</title><content type='html'>We had several reports of issues in the past with use of FreeMarker on Google App Engine (GAE).&lt;br /&gt;&lt;br /&gt;Analysis of these problems confirmed that runtime named &quot;Java&quot; in GAE is not, in fact, a Java-compliant runtime even though it&#39;s advertised as such, and looks like one at first sight. It doesn&#39;t provide access to some mandatory Java packages, and its reflection implementation has bugs; both of which issues affect FreeMarker.&lt;br /&gt;&lt;br /&gt;We wish to stress that FreeMarker is being used in countless Java runtimes, many of them enterprise runtimes with strict security lockdowns, and it works in all of them, as long as these runtimes are conforming Java Runtime Environments. It is our belief that GAE is, unfortunately, non-conforming. &lt;b&gt;Update: I have now &lt;a href=&quot;http://code.google.com/p/googleappengine/issues/detail?id=2790&quot;&gt;reported the reflection bug&lt;/a&gt; in the GAE issue tracker.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This unfortunately doesn&#39;t help our users who would love to use FreeMarker on GAE. We can not quickly patch FreeMarker as some of the required workarounds would break backwards compatibility within the existing 2.3.x series, which is against our release policy; backwards compatible changes are only allowed when we increment first or second version numbers, that is, from current perspective, either in 2.4 or 3.0.&lt;br /&gt;&lt;br /&gt;For this reason, I spent some of my weekend on this particular yak shaving, and have created a new version of FreeMarker&#39;s 2.3.16 JAR file that &lt;i&gt;should&lt;/i&gt; run on GAE. I&#39;m saying &quot;should&quot; because I don&#39;t use GAE myself, so it&#39;s up to you, the GAE users to verify it.&lt;br /&gt;&lt;br /&gt;If you want to, please go to our &lt;a href=&quot;https://sourceforge.net/projects/freemarker/files/&quot;&gt;project file releases&lt;/a&gt;, and grab &quot;freemarker-gae-pre1.jar&quot; from freemarker/2.3.16 directory. The file is labelled &quot;pre1&quot; as it&#39;s considered a prerelease; all you people who wish to use FreeMarker on GAE, please start using it and hammer at it, and report back any problems you can find. That said, I sincerely hope there will be none. The changes themselves are fairly light: I removed the dependency on Swing from AST classes, and worked around GAE&#39;s reflection security bugs. (If you see a different named file, it means we&#39;ve updated it since, and please grab that more recent one.)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Update: There is now indeed a &quot;freemarker-gae-pre3.jar&quot;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This doesn&#39;t replace our longer term effort of having default FreeMarker be able to run under GAE, but is intended to help our users with an instant solution. There are no downsides to using this version instead of the official 2.3.16 release of FreeMarker, except for the backwards-incompatible change where the &lt;tt&gt;TemplateElement&lt;/tt&gt; class no longer implements Swing &lt;tt&gt;TreeNode&lt;/tt&gt;, but that incompatibility is probably exactly what you want under GAE. All other changes are under the hood - we had to expose few previously package-private implementation classes as being public to work around GAE&#39;s reflection security bugs. Since these classes are not documented in FreeMarker official JavaDoc anyway, they don&#39;t form the public API, so you shouldn&#39;t be using them even when you see them.</content><link rel='replies' type='application/atom+xml' href='http://freemarker.blogspot.com/feeds/5043543105561444350/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/22457957/5043543105561444350' title='23 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/5043543105561444350'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/5043543105561444350'/><link rel='alternate' type='text/html' href='http://freemarker.blogspot.com/2010/02/freemarker-on-google-app-engine.html' title='FreeMarker on Google App Engine'/><author><name>Attila Szegedi</name><uri>http://www.blogger.com/profile/08179252447170860637</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWwxGUh32u_2eeSs3KazexD2seNWQlQR7QNwOnD3CrHpF7EeV8QMV4Hl10YbMp1ibrLccXyTGsjFXkWMSnKQg0swFSbfxDUppNAapgk6h5sllMGNEH956O5-6xQWvlQrs/s220/face.jpg'/></author><thr:total>23</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22457957.post-2481664614432372150</id><published>2009-12-08T14:13:00.002+01:00</published><updated>2009-12-08T14:16:19.183+01:00</updated><title type='text'>FreeMarker 2.3.16 released</title><content type='html'>FreeMarker 2.3.16 is out! Download it from &lt;a href=&quot;http://prdownloads.sourceforge.net/freemarker/freemarker-2.3.16.tar.gz&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br&gt;This is mainly a bugfix release; you can see the &lt;a href=&quot;http://freemarker.org/docs/versions_2_3_16.html&quot;&gt;full changelog&lt;/a&gt; for details.</content><link rel='replies' type='application/atom+xml' href='http://freemarker.blogspot.com/feeds/2481664614432372150/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/22457957/2481664614432372150' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/2481664614432372150'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/2481664614432372150'/><link rel='alternate' type='text/html' href='http://freemarker.blogspot.com/2009/12/freemarker-2316-released.html' title='FreeMarker 2.3.16 released'/><author><name>Attila Szegedi</name><uri>http://www.blogger.com/profile/08179252447170860637</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWwxGUh32u_2eeSs3KazexD2seNWQlQR7QNwOnD3CrHpF7EeV8QMV4Hl10YbMp1ibrLccXyTGsjFXkWMSnKQg0swFSbfxDUppNAapgk6h5sllMGNEH956O5-6xQWvlQrs/s220/face.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22457957.post-764714511256498173</id><published>2008-02-04T08:41:00.000+01:00</published><updated>2008-02-04T08:49:41.039+01:00</updated><title type='text'>FreeMarker 2.3.12 released</title><content type='html'>FreeMarker 2.3.12 is out! Download it from &lt;a href=&quot;http://prdownloads.sourceforge.net/freemarker/freemarker-2.3.12.tar.gz&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;We fixed one really ugly (and really stupid to make) bug that made the JSP 2.0 SimpleTag support introduced in 2.3.11 immediately unusable (ouch). Everything gets better at second attempt, I guess, so it works now; with my apologies to anyone bitten by it.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;FreeMarker&#39;s praised error reporting got even (a bit) better: parse-time exception messages now display the name of the template in addition to line and column number (I too can&#39;t believe we didn&#39;t have this earlier).&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Variable argument methods (introduced with Java 5) on Java objects can now be properly invoked (in case of overloaded methods, observing the same rules for method resolution that the Java language itself uses).&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Finally, Java 5 enum constants are now identified by their name, not their toString() representation (which can be overridden in a subclass). They still print their toString() representation, of course.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://freemarker.blogspot.com/feeds/764714511256498173/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/22457957/764714511256498173' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/764714511256498173'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/764714511256498173'/><link rel='alternate' type='text/html' href='http://freemarker.blogspot.com/2008/02/freemarker-2312-released.html' title='FreeMarker 2.3.12 released'/><author><name>Attila Szegedi</name><uri>http://www.blogger.com/profile/08179252447170860637</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWwxGUh32u_2eeSs3KazexD2seNWQlQR7QNwOnD3CrHpF7EeV8QMV4Hl10YbMp1ibrLccXyTGsjFXkWMSnKQg0swFSbfxDUppNAapgk6h5sllMGNEH956O5-6xQWvlQrs/s220/face.jpg'/></author><thr:total>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22457957.post-6221626564726760125</id><published>2007-12-05T09:17:00.000+01:00</published><updated>2007-12-05T10:45:12.897+01:00</updated><title type='text'>FreeMarker 2.3.11 released</title><content type='html'>We&#39;re pleased to announce that FreeMarker 2.3.11 is now released. This release contains several important bugfixes, performance improvements (both speed and memory), as well as some major feature improvements. It is &lt;i&gt;almost&lt;/i&gt; completely backwards compatible with any other 2.3.x version and as such can be used as a drop-in replacement for them. (The only non-backwards compatible change is that &lt;code&gt;?c&lt;/code&gt; built-in formats numbers differently than it did earlier, but that is actually a bug fix).&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://prdownloads.sourceforge.net/freemarker/freemarker-2.3.11.tar.gz&quot;&gt;Download it from SourceForge&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You can look at the &lt;a href=&quot;http://www.freemarker.org/docs/versions_2_3_11.html&quot;&gt;full list of changes&lt;/a&gt;, but I&#39;ll summarize it here by topic:&lt;br /&gt;&lt;h2&gt;New features&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;We now have much better JSP 2.0 and JSP 2.1 compliance. Most notably, JSP tags implementing &lt;code&gt;SimpleTag&lt;/code&gt; interface will now work.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;We have better Rhino compliance as well: Rhino objects can be used in templates as scalars, numbers, and booleans, following the JavaScript conversion semantics for these types.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;We created a new interface, &lt;code&gt;TemplateDirectiveModel&lt;/code&gt; that should make writing custom directives in Java much easier than with the previous only choice, &lt;code&gt;TemplateTransformModel&lt;/code&gt;.&lt;/li&gt;&lt;/ul&gt;And then there&#39;s the small things, i.e. &lt;code&gt;FileTemplateLoader&lt;/code&gt; can now load templates through symlinks pointing out of its root directory (it is disabled by default however).&lt;br /&gt;&lt;h2&gt;Performance improvements&lt;/h2&gt;We eliminated a bunch of repeated &lt;code&gt;instanceof&lt;/code&gt; tests in BeansWrapper whenever a new object was wrapped. They&#39;re now performed once per class instead of once per object. Also, the FreeMarker wrapper object created by BeansWrapper when wrapping a POJO now does not create an internal &lt;code&gt;HashMap&lt;/code&gt; automatically, but only when really needed (and it is not needed often). Thus, we eliminated one &lt;code&gt;HashMap&lt;/code&gt; per wrapped object in lots of use cases, noticeably reducing the runtime memory footprint.&lt;br /&gt;&lt;h2&gt;Bug fixes&lt;/h2&gt;As mentioned, &lt;code&gt;?c&lt;/code&gt; built-in now prints numbers in the expected format &lt;i&gt;always&lt;/i&gt;. Also, there is a serious file handle leak when loading resources from JAR files from local filesystem in Sun JVMs, and we now have a workaround for it. FreeMarker will now correctly find JRE-bundled Xalan when run on Java 5 and Java 6. Also, we corrected the lookup of JSP taglib JAR files to be fully compliant with the JSP specification. And there are some more I won&#39;t go into right now - see the full changelog page linked above.</content><link rel='replies' type='application/atom+xml' href='http://freemarker.blogspot.com/feeds/6221626564726760125/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/22457957/6221626564726760125' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/6221626564726760125'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/6221626564726760125'/><link rel='alternate' type='text/html' href='http://freemarker.blogspot.com/2007/12/freemarker-2311-released.html' title='FreeMarker 2.3.11 released'/><author><name>Attila Szegedi</name><uri>http://www.blogger.com/profile/08179252447170860637</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWwxGUh32u_2eeSs3KazexD2seNWQlQR7QNwOnD3CrHpF7EeV8QMV4Hl10YbMp1ibrLccXyTGsjFXkWMSnKQg0swFSbfxDUppNAapgk6h5sllMGNEH956O5-6xQWvlQrs/s220/face.jpg'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22457957.post-5017456009165978181</id><published>2007-12-02T20:37:00.002+01:00</published><updated>2008-03-23T22:19:26.667+01:00</updated><title type='text'>Velocity or FreeMarker: Looking at 5 Years of Practical Experience</title><content type='html'>This month&#39;s Javaworld contains an article by Jeroen Van Bergen entitled &lt;a href=&quot;http://www.javaworld.com/javaworld/jw-11-2007/jw-11-java-template-engines.html?fsrc=rss-index&quot;&gt;&quot;Velocity or FreeMarker&quot;.&lt;/a&gt; While it is, of course, nice to get such good publicity for our project, I have certain misgivings about the article and I feel it is necessary to make certain points about it. I have chosen to do so on this blog because this entry will provide a basic link to refer people to in the future, any time we feel these points need to be made.&lt;br /&gt;&lt;br /&gt;Here is my central concern about the aforementioned article: typical readers, not very familiar with the template space, will come away with the idea that Velocity and FreeMarker are broadly comparable in functionality, and that it does not matter very much which one you choose. However, they would be extremely mistaken. There is now five years of practical experience that shows that, in the general case, Velocity is not a sufficiently capable tool for professional use. This is why so many projects -- among them some of the most visible projects in the java world, things like Hibernate, Webwork/Struts 2, and Netbeans -- used Velocity at some earlier stage, but have since migrated to FreeMarker.&lt;br /&gt;&lt;br /&gt;Quite amazingly, Mr. Van Bergen&#39;s article makes no mention of any of this. So let me start by filling in some of this background.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Max&#39;s story about FreeMarker and Velocity&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;One of the better known cases of a project switching from Velocity to FreeMarker is Hibernate tools. In early 2006, the lead developer, Max Andersen, wrote a &lt;a href=&quot;http://in.relation.to/Bloggers/AStoryAboutFreeMarkerAndVelocity&quot;&gt;blog entry&lt;/a&gt; about this that generated some buzz. While Max outlined various issues he had with Velocity, his biggest problem, the central message, was that he simply could not get Velocity to provide useful error messages. If he misspelt a variable somewhere in a template, the default behavior was just to keep going as if nothing happened. Even if he configured Velocity to throw an exception at this point, he had no information about the line number or even the file in which the error occurred.&lt;br /&gt;&lt;br /&gt;Now, to be fair, the most recent version of Velocity has some improvements on this front. However, Velocity is still quite weak in error reporting compared to FreeMarker, and real practical experience with both tools shows that the lack of good error messages can be a huge drag on developer productivity.&lt;br /&gt;&lt;br /&gt;Error messages were also one of the two stated reasons that the Webwork project, in early 2005, switched from using Velocity by default to FreeMarker. The other was FreeMarker&#39;s support for JSP taglibs. Note that Webwork later was donated to the Apache Software Foundation and was renamed &quot;Struts 2&quot;. At around this time, Matthew Porter wrote a &lt;a href=&quot;http://www.jroller.com/webwork2live/entry/switch_to_freemarker_from_velocity&quot;&gt;blog entry&lt;/a&gt; describing his switch from Velocity to FreeMarker for all his development.&lt;br /&gt;&lt;br /&gt;Now, meanwhile, other people undertook the same migration but for other reasons. Consider &lt;a href=&quot;http://blog.nominet.org.uk/tech/2005/06/29/moving-from-velocity-to-freemarker&quot;&gt;Matt Ward&#39;s blog entry&lt;/a&gt; from mid-2005. One of Matt&#39;s main problems with Velocity was that Velocity simply did not address the whole issue of outputting numbers, dates, and currencies, for different audiences, despite the fact that the information to do this is embedded in the core java libraries. Another issue for Matt was Velocity&#39;s lack of robust support for macro libraries. FreeMarker supports the notion of namespaces so that different sets of macros can define variables without any fear of them clobbering one another.&lt;br /&gt;&lt;br /&gt;More recently, it has come to our attention that Netbeans 6 leverages FreeMarker for templating functionality. (Previous versions were using Velocity.) I have not seen any public explanation of their reasons, but I infer that they were running into various limitations of Velocity, and were looking for a better tool and opted to migrate towards FreeMarker. Consider &lt;a href=&quot;http://blogs.sun.com/satya/entry/migrate_to_freemarker_from_velocity&quot;&gt;this blog entry&lt;/a&gt; outlining how to adapt to the change to FreeMarker. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;What about changes in the other direction?&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Now, so far, I have provided examples of people switching from Velocity to Freemarker, but none of anybody going in the opposite direction. Well, feel free to look for examples of this. Google is your friend. &lt;br /&gt;&lt;br /&gt;I can only find one example. In &lt;a href=&quot;http://www.howardism.org/thoughts/001511.html&quot;&gt;this blog entry,&lt;/a&gt; Howard Abrams, a long-time FreeMarker user, describes his experience switching to Velocity. Except that he finds Velocity to be too limited, and switches back to FreeMarker!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Final Points&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;In the foregoing, I highlighted examples of 5 years of practical experience that the java development community has had with Velocity and FreeMarker. Jeroen Van Bergen&#39;s article simply omits all of this. While that is surely the central problem, I should still point out other issues with the comparison carried out in the article.&lt;br /&gt;&lt;br /&gt;For example, on the last page is a feature checklist chart, showing features that FreeMarker has and Velocity has. FreeMarker allows iteration, Velocity allows iterations, FreeMarker has macros, Velocity has macros. And so on. The chart is outrageously misleading, because it suggests that the two tools are comparable functionally. But that is simply because it omits all the features that FreeMarker has that Velocity lacks! &lt;br /&gt;&lt;br /&gt;A more complete list would contain things like:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Support for transparent i18n with numbers and dates shown according to the relevant locale: FreeMarker, yes. Velocity, no.&lt;br /&gt;&lt;li&gt;Support for JSP taglibs: FreeMarker, yes. Velocity, no.&lt;br /&gt;&lt;li&gt;Support for Jython and Rhino: FreeMarker, yes. Velocity, no.&lt;br /&gt;&lt;li&gt;Special tags for stripping of extraneous whitespace: FreeMarker, yes. Velocity, no.&lt;br /&gt;&lt;li&gt;Support for auto-escaping interpolations on blocks of text (converting problematic characters to HTML entities, for example): FreeMarker, yes. Velocity, no.&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;Also, just consider the statement that FreeMarker has macros and Velocity has macros, with no further elaboration. It is actually true, as far as that goes, but it is certainly quite misleading. Now, it is true that in paragraph below that feature checklist chart, the author does mention that FreeMarker&#39;s macro system has some additional capabilities. However, the basic impression given from the way the information is presented is that the difference is at most marginal. Surely, a more complete feature checklist of the tools&#39; respective macro capabilities is called for and that would be something like:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Support for importing a set of macros (macro library) in a separate namespace to avoid variable naming clashes: FreeMarker, yes, Velocity, no.&lt;br /&gt;&lt;li&gt;Support for macros with an associated template block: FreeMarker, yes, Velocity, no.&lt;br /&gt;&lt;li&gt;Support for optional and default parameters in macro calls: FreeMarker, yes. Velocity, no.&lt;br /&gt;&lt;li&gt;Output of the macro call stack when an error is hit: FreeMarker, yes. Velocity, no.&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;Right below this, Mr. Van Bergen mentions Anakia, which is an add-on to Velocity for processing XML. He neglects to mention that FreeMarker provides similar XML processing functionality (though the implementation is much more complete, since it supports XML namespaces, for example) as part of its core feature set. Declarative XML processing is supported in FreeMarker via the #visit and #recurse directives, which are core directives in the FreeMarker language. One would infer from what the article says that XML processing is a point in favor of Velocity, when, really, quite the opposite is the case. The XML processing functionality available for Velocity is add-ons like Anakia and DVSL that are basically abandonware, where the XML processing support in FreeMarker is a core part of the product, and is clearly supported.&lt;br /&gt;&lt;br /&gt;Still, the central problem with this article and the comparison it undertakes is that it ignores this huge body of evidence from real-world experience that all points to a very clear conclusion: quite frequently, people switch to FreeMarker after hitting Velocity&#39;s limitations. In Max Andersen&#39;s case, it was the poor to nonexistent error reporting, where for other people, it is Velocity&#39;s half-baked, rather buggy implementation of macros. And then, in other cases, the deal breaker is Velocity&#39;s lack of transparent support for internationalization. But regardless of the reasons in the specific case, it is quite clear that there has been a large migration from Velocity to FreeMarker and virtually no movement in the opposite direction. In the foregoing, I mentioned cases that are highly visible like Netbeans or Hibernate. We can only speculate about how many projects are out there, most of them not visible at all, because they are in a company&#39;s closed codebase, that have ended up undertaking a similar migration. In any of these cases, the people involved could have saved themselves a lot of time and effort by opting for FreeMarker in the first place, rather than starting with Velocity, discovering its limitations, and then having to migrate. So, it serves the readers of a publication like Javaworld rather poorly to have articles that foster the misconception that FreeMarker and Velocity are broadly comparable in functionality. They are not. There is an overwhelming body of evidence from real-world praxis that shows this quite clearly.</content><link rel='replies' type='application/atom+xml' href='http://freemarker.blogspot.com/feeds/5017456009165978181/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/22457957/5017456009165978181' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/5017456009165978181'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/5017456009165978181'/><link rel='alternate' type='text/html' href='http://freemarker.blogspot.com/2007/12/velocity-of-freemarker-looking-at-5.html' title='Velocity or FreeMarker: Looking at 5 Years of Practical Experience'/><author><name>Jonathan Revusky</name><uri>http://www.blogger.com/profile/14215082065572028879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22457957.post-8495374772289396219</id><published>2007-08-19T16:03:00.000+02:00</published><updated>2007-08-19T20:08:22.614+02:00</updated><title type='text'>New features in the next release</title><content type='html'>We&#39;re nearing the release of FreeMarker 2.3.11. You can try out the &lt;a href=&quot;http://freemarker.org:8085/download/FM-BRANCH23/artifacts/build-7/Library/freemarker.jar&quot;&gt;latest freemarker.jar build&lt;/a&gt; right now if you can allow yourself to run experimental code and provide us with feedback. Just download it and drop it in place of your existing FreeMarker 2.3.x JAR file. Here&#39;s a nonexhaustive list of new and improved features:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Probably the biggest news is that we support JSP 2.0 SimpleTag now. More precisely, you can now use JSP custom tags that implement the SimpleTag interface within FreeMarker.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;BeansWrapper&#39;s wrapping performance has been significantly improved. Previously, we did a bunch of &lt;i&gt;instanceof&lt;/i&gt; checks on each object to figure out how to wrap it. Now, we perform only one lookup per class (instead of per object!), and subsequently quickly dispatch to wrapping code based on the class of the object. &lt;a href=&quot;#d&quot;&gt;&lt;sup&gt;*&lt;/sup&gt;&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Memory footprint of object wrappers using BeansWrapper has been reduced; we no longer create a per-object member map for each wrapper until you invoke a method through the wrapper. Property accesses don&#39;t count, so you get a reduced memory footprint if you use &lt;tt&gt;${foo.prop}&lt;/tt&gt; but you don&#39;t get it for &lt;tt&gt;${foo.getProp()}&lt;/tt&gt;. As in majority of cases, people tend to use properties, this has the potential to significantly reduce the load on GC.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;When using Rhino JavaScript objects as data models in template, they are recognized as boolean, number, and string values following the JavaScript conversion semantics to these types.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;&lt;a name=&quot;d&quot;&gt;&lt;sup&gt;*&lt;/sup&gt;&lt;/a&gt; People who subclass BeansWrapper and override &lt;tt&gt;getInstance(Object, ModelFactory)&lt;/tt&gt; will need to instead override the new &lt;tt&gt;getModelFactory(Class)&lt;/tt&gt; method to take advantage of performance improvement. Overriding the old method still works (we promise to keep backwards compatibility within a major release), but doesn&#39;t realize the performance benefit.</content><link rel='replies' type='application/atom+xml' href='http://freemarker.blogspot.com/feeds/8495374772289396219/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/22457957/8495374772289396219' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/8495374772289396219'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/8495374772289396219'/><link rel='alternate' type='text/html' href='http://freemarker.blogspot.com/2007/08/new-features-in-next-release.html' title='New features in the next release'/><author><name>Attila Szegedi</name><uri>http://www.blogger.com/profile/11586966395114113526</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22457957.post-3984892581103958277</id><published>2007-07-09T11:58:00.000+02:00</published><updated>2007-07-09T12:05:43.007+02:00</updated><title type='text'>FreeMarker sketchbook</title><content type='html'>&lt;a href=&quot;http://www.bitwalker.nl/blog/freemarker-sketchbook&quot;&gt;FreeMarker sketchbook&lt;/a&gt; is a quite polished (especially for a &quot;0.1&quot; release!) online playground for exploring FreeMarker. It&#39;s a JLNP application, and it launches into a Swing application with a tabbed window with tabs containg the full FreeMarker manual, a sample data model, an editor for the template, a HTML viewer for the output, and a HTML source viewer for the output. &lt;br /&gt;&lt;br /&gt;Neat!</content><link rel='replies' type='application/atom+xml' href='http://freemarker.blogspot.com/feeds/3984892581103958277/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/22457957/3984892581103958277' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/3984892581103958277'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/3984892581103958277'/><link rel='alternate' type='text/html' href='http://freemarker.blogspot.com/2007/07/freemarker-sketchbook.html' title='FreeMarker sketchbook'/><author><name>Attila Szegedi</name><uri>http://www.blogger.com/profile/11586966395114113526</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22457957.post-601134304662459424</id><published>2007-06-25T14:03:00.000+02:00</published><updated>2007-06-25T14:27:01.403+02:00</updated><title type='text'>..the programmer who is in agony with business...</title><content type='html'>A bunch of years ago, I was interested in the whole topic of machine translation and had a look at it. A lot of people were making various claims about the technology. I eventually came to the conclusion that machine translation, to put it mildly, did not work very well. In fact, I believed at the time that businesses and government agencies investing in this tech were, at least at that point in history, throwing away their money. &lt;br /&gt;&lt;br /&gt;It definitely did not seem that human translators&#39; jobs were under very much threat at all -- certainly not in the short term, almost certainly not in the mid-term. (Maybe in the long run, but in the long run, we&#39;re all dead...)&lt;br /&gt;&lt;br /&gt;I was kind of wondering, what with all the cycles of Moore&#39;s law and so on, whether there was some brute force method that made use of all that, and produced better results than back then. And, you know, some improvements must have been made, what with some very smart people working on what is surely one of the biggest AI problems of them all, natural language processing.&lt;br /&gt;&lt;br /&gt;Anyway, what does this have to do with FreeMarker? Well, about a year ago, I wrote an article in this very blog about the designer-developer division of labor.  This must have made some impression on at least somebody. I somehow noticed recently that somebody had gone through the bother of translating it (not quite all of it, I don&#39;t think, he probably got tired) into Korean and putting it &lt;a href = &quot;http://www.blo9.com/wp/?p=261&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Quite flattering that somebody would translate my rambling into Korean...&lt;br /&gt;&lt;br /&gt;I&#39;d actually noticed this a while ago. Today, it occurred ot me to run the translation through translate.google.com to put it back in English. Just out of curiosity. &lt;a href=&quot;http://translate.google.com/translate?hl=en&amp;sl=ko&amp;u=http://www.blo9.com/wp/%3Fp%3D261&amp;sa=X&amp;oi=translate&quot;&gt;This&lt;/a&gt; is what you get. It starts off something like:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Relates with the template engine and the general concept which becomes known two basic groups (the programmer who is in agony [cik] with business and web site is beautiful the designer who pursues) effort between the low of the union is one.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;And there are later gems, such as:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;The graphic designer American part of head of a family web site it is in agony, ...&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;That program thinks people are in a lot of agony, doesn&#39;t it?&lt;br /&gt;&lt;br /&gt;Well, there it is. Of course, I anticipate that Daniel Dekany will say that this retranslation is an improvement over my original text. After all, there is no accounting for tastes.</content><link rel='replies' type='application/atom+xml' href='http://freemarker.blogspot.com/feeds/601134304662459424/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/22457957/601134304662459424' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/601134304662459424'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/601134304662459424'/><link rel='alternate' type='text/html' href='http://freemarker.blogspot.com/2007/06/programmer-who-is-in-agony-with.html' title='..the programmer who is in agony with business...'/><author><name>Jonathan Revusky</name><uri>http://www.blogger.com/profile/14215082065572028879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22457957.post-3064525268711001024</id><published>2007-04-22T11:37:00.000+02:00</published><updated>2007-04-22T11:43:45.521+02:00</updated><title type='text'>2.3.11 roadmap - focusing on JSP improvements</title><content type='html'>For the FreeMarker&#39;s next release (2.3.11) I will focus on improving the JSP tag library support. We have one bug &lt;a href=&quot;https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1670887&amp;group_id=794&amp;atid=100794&quot;&gt;reported&lt;/a&gt; for FreeMarker not complying completely to JSP specification for the lookup order of tag library JAR files as well as one &lt;a href=&quot;https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1596226&amp;group_id=794&amp;atid=350794&quot;&gt;feature request&lt;/a&gt; for supporting JSP 2.0 SimpleTags. Both of these are rather nontrivial to implement, so they&#39;ll take some time. (Also, this is not to say these will be the only changes for 2.3.11.)&lt;br /&gt;&lt;br /&gt;Of course, all of these improvements also go into the (separately maintained) codebase for our next major release, 2.4.0.</content><link rel='replies' type='application/atom+xml' href='http://freemarker.blogspot.com/feeds/3064525268711001024/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/22457957/3064525268711001024' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/3064525268711001024'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/3064525268711001024'/><link rel='alternate' type='text/html' href='http://freemarker.blogspot.com/2007/04/2311-roadmap-focusing-on-jsp.html' title='2.3.11 roadmap - focusing on JSP improvements'/><author><name>Attila Szegedi</name><uri>http://www.blogger.com/profile/11586966395114113526</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22457957.post-1957681951557959913</id><published>2007-04-22T11:26:00.000+02:00</published><updated>2007-04-22T11:33:06.968+02:00</updated><title type='text'>FreeMarker 2.3.10 is released</title><content type='html'>We&#39;re pleased to announce that FreeMarker 2.3.10 is now released. This release contains several important bugfixes and minor feature improvements. It is completely backwards compatible with any other 2.3.x version and as such can be used as a drop-in replacement for them.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://prdownloads.sourceforge.net/freemarker/freemarker-2.3.10.tar.gz&quot;&gt;Download from SourceForge&lt;/a&gt;&lt;br /&gt; &lt;br /&gt;&lt;a href=&quot;http://www.freemarker.org/docs/versions_2_3_10.html&quot;&gt;Full list of changes&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://freemarker.blogspot.com/feeds/1957681951557959913/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/22457957/1957681951557959913' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/1957681951557959913'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/1957681951557959913'/><link rel='alternate' type='text/html' href='http://freemarker.blogspot.com/2007/04/freemarker-2310-is-released.html' title='FreeMarker 2.3.10 is released'/><author><name>Attila Szegedi</name><uri>http://www.blogger.com/profile/11586966395114113526</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22457957.post-6008818346571541091</id><published>2007-01-26T11:50:00.000+01:00</published><updated>2007-01-26T11:51:45.705+01:00</updated><title type='text'>Apologies</title><content type='html'>To folks who get this blog on RSS feed -- sorry for the last two posts (they have been deleted now). They don&#39;t have anything to do with FreeMarker, and were meant to go to my personal blog, and ended up by my mistake on this blog...</content><link rel='replies' type='application/atom+xml' href='http://freemarker.blogspot.com/feeds/6008818346571541091/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/22457957/6008818346571541091' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/6008818346571541091'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/6008818346571541091'/><link rel='alternate' type='text/html' href='http://freemarker.blogspot.com/2007/01/apologies.html' title='Apologies'/><author><name>Attila Szegedi</name><uri>http://www.blogger.com/profile/11586966395114113526</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22457957.post-4140559396078941579</id><published>2007-01-24T09:39:00.000+01:00</published><updated>2007-01-24T09:44:18.605+01:00</updated><title type='text'>FreeMarker 2.3.9 released</title><content type='html'>FreeMarker 2.3.9 is now available.&lt;br /&gt; &lt;br /&gt;You can download it directly from &lt;a href=&quot;http://prdownloads.sourceforge.net/freemarker/freemarker-2.3.9.tar.gz&quot;&gt;here&lt;/a&gt;&lt;br /&gt; &lt;br /&gt;This release adds support for accessing Java 5 enums and public fields of classes in templates, as well one bugfix in RhinoWrapper.&lt;br /&gt; &lt;br /&gt;Detailed changes on the Java side:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;BeansWrapper can now expose public fields of objects to the template if you call the setExposeFields(true) on it.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Support for JDK 1.5 enums in BeansWrapper and DefaultObjectWrapper. By calling the getEnumModels() method, you can retrieve a hash model that is keyed by class names and allows access to enumerated values. I.e. if you bind this hash model under name enums in the data model, you can write expressions like enums[&quot;java.math.RoundingMode&quot;].UP in the template. The enum values can be used as scalars and support equality and inequality comparisons.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;freemarker.ext.rhino.RhinoWrapper now correctly translates Rhino Undefined instance, UniqueTag.NOT_FOUND, and UniqueTag.NULL to FreeMarker undefined value.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;Please note that currently only &lt;a href=&quot;http://fremarker.sourceforge.net&quot;&gt;http://fremarker.sourceforge.net&lt;/a&gt; is up-to-date regarding 2.3.9. http://www.freemarker.org will be updated as soon as I get access credentials to it.</content><link rel='replies' type='application/atom+xml' href='http://freemarker.blogspot.com/feeds/4140559396078941579/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/22457957/4140559396078941579' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/4140559396078941579'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/4140559396078941579'/><link rel='alternate' type='text/html' href='http://freemarker.blogspot.com/2007/01/freemarker-239-released.html' title='FreeMarker 2.3.9 released'/><author><name>Attila Szegedi</name><uri>http://www.blogger.com/profile/11586966395114113526</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22457957.post-116479113191318968</id><published>2006-11-29T09:52:00.000+01:00</published><updated>2006-12-21T07:38:09.640+01:00</updated><title type='text'>2.3.9 coming soon</title><content type='html'>We&#39;re about to release the version 2.3.9 of FreeMarker soon. It&#39;ll be a release that adds few minor features to 2.3.8, most notably support for accessing public fields of classes as well as JDK 5.0 enumerations from templates. Plus there are few miscellaneous bugfixes in less used areas of the codem, namely Rhino support and the remote debugger. The reason we&#39;re delaying the release a bit is to get some feedback on the remote debugger fixes first - there is someone out there trying to write an Eclipse IDE plugin on top of that.</content><link rel='replies' type='application/atom+xml' href='http://freemarker.blogspot.com/feeds/116479113191318968/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/22457957/116479113191318968' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/116479113191318968'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/116479113191318968'/><link rel='alternate' type='text/html' href='http://freemarker.blogspot.com/2006/11/239-coming-soon.html' title='2.3.9 coming soon'/><author><name>Attila Szegedi</name><uri>http://www.blogger.com/profile/11586966395114113526</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22457957.post-115271983040535993</id><published>2006-07-12T17:54:00.000+02:00</published><updated>2006-07-12T18:11:20.493+02:00</updated><title type='text'>The Designer/Developer Division of Labor Revisited (Alternative Title: The Three-Way Manifesto)</title><content type='html'>The conventional wisdom floating around about template engines is that they facilitate a division of labor between two basic groups: programmers, who are concerned with business logic, and designers, people who are more concerned with the aesthetics of a website. &lt;br /&gt;&lt;br /&gt;I reckon that this whole argument has become so commonplace as to have become a kind of overused clich&amp;eacute;. Of course, if this is the case, we are as guilty as anybody. Certainly, we dutifully expound this idea in the introductory pages of the FreeMarker documentation. In fact, the organization of our documentation, where there is a separate standalone part that is for designers and another part specifically for programmers, reflects the 2-way division of labor that is being promoted.&lt;br /&gt;&lt;br /&gt;Of course, the whole thing has a certain conceptual beauty to it. After all, there are two sexes (approximately, anyway) and most people are at least vaguely aware of the brain mapping research regarding the two hemispheres of the brain and their respective specialties. So, in this vein, that there are two basic kinds of people involved in web development just fits in with all of this in a very conceptually neat kind of way.&lt;br /&gt;&lt;br /&gt;Now, I don&#39;t mean to say that this is invalid. Of course, different people are good at different things. Having hard-core programmers work on designing web pages is usually disastrous. It is even more obvious that you cannot expect people who are good at graphical design to do much programming. The idea I want to develop here is that the 2-way division of labor is, in the general case, an oversimplification, and it may be better to think of things in terms of 3 basic roles: application programmer, graphical designer, and website integrator. &lt;br /&gt;&lt;br /&gt;I guess it is clear enough that application programmers write code in a language like Java. Broadly speaking, they are concerned with defining the back-end data structures and the algorithms that operate on that data. As regards their contact with a templating system, application programmers would, ideally, be able to hand off data to the front end of a system and suppose that it will be displayed appropriately. Graphical designers are mostly concerned with the aesthetics of a website, so they spend a lot of time in programs like Freehand and Illustrator and so on. (As a side note, I, a professional programer, have never opened either of those programs and don&#39;t even know what they look like on-screen.)&lt;br /&gt;&lt;br /&gt;The problem that I see with dividing the work of web development into the above two categories is that it seems to leave a very big gray area in the middle, where it is not so clear whose territory it is. Now, of course, once things reach a certain level of complexity, one cannot usually fit everything into neat unambiguous categories. So, this is normal, up to a point. But this is really a very very large gray zone. It definitely seems to me that, at this stage of history, to master all of the various web-related standards such as javascript with dynamic HTML, and cascading style sheets, along with technologies such as FreeMarker, is a sufficiently large undertaking that it comprises a respectable professional specialty or subspecialty at least. Insofar as things like Oracle database admin or unix sysadmin are also recognized job categories, there is no reason that this should not be. And I think that, increasingly, it is.&lt;br /&gt;&lt;br /&gt;So, I have been wondering whether thinking about web development in terms of a 3-way division of labor will often be more useful than the two-way designer/developer dichotomy. In terms of FreeMarker, it allows us to think more clearly about who uses what features, and the basic real-world problem space that motivates them. (However, I think the 3-way paradigm could also be useful to people who are thinking about developing other, related tools in the space, such as web application frameworks.)&lt;br /&gt;&lt;br /&gt;Now, in the 2-way division of labor, how does one go about working up a website with dynamic pages? Well, one way -- the approach I myself have typically used -- is that the programmer types work up some basic web app with very basic, ugly page templates and the templates are handed off to the designers who beautify them. The other way would be for the non-programmers (designers along with the marketing types) to work up the web pages with dummy forms and dummy data and then hand off these pretty but non-functional pages to the developers to templatize them and render them functional. &lt;br /&gt;&lt;br /&gt;So, basically, either you start with functional, ugly templates and make them visually appealing, or you start with pretty, non-functional pages and templatize them, rendering them functional. You have these two basic approaches. Which is better? My sense of things is that this would be a sterile debate, akin to discussing whether it is to crack open a boiled egg on the small or the large end. The same result can be achieved effectively either way.&lt;br /&gt;&lt;br /&gt;Actually, my sense of things is that if that was all there was to it, the 2-way division of labor would be a reasonable paradigm. The problem with the above scenarios is that they really relate to the initial step of developing a prototype. They don&#39;t model the multiple iterations and shifting requirements and (sometime chaos and confusion) that occur over the entire life cycle of the project. It also begs the question of how you reuse presentational elements when you start a new, related project. Surely, you don&#39;t want to start from zero each time when so much of the same problems recur over and over... And, in general, there is a danger in thinking that an approach that yields quick results for developing a prototype is going to be the best approach for long-term development; it&#39;s not necessarily so.&lt;br /&gt;&lt;br /&gt;For starters, in web-based development, a huge amount of painstaking work goes into making sure that a site is usable in different browsers, at different resolutions, and so on. Also, there is a whole set of problems involved with creating branded and localized versions of a product or service. Moreover, I am sure that it is fairly common that new requirements in this regard may be introduced at a fairly late stage of the development cycle. &lt;br /&gt;&lt;br /&gt;Now, on the one hand, these are problems that are hardly trivial in nature. But, on the other hand, the same basic problems keep recurring (though with minor variations perhaps). In any case, once you&#39;ve invested a lot of time into figuring out how to get some nice table-based presentation to show up well on different browsers and at different resolutions, it is natural to want to encapsulate your solution so that it can be reused elsewhere, especially when you anticipate that people will at some point want a Spanish language version of the site, say, or just to do something very similar in another context (though slighty different.) Of course, the basic antipattern of copy-paste-modify is always available, but, just as in hard-core programming, there are huge gains to be had long-term by avoiding this. Once you&#39;ve solved a problem once, you should want to encapsulate the solution and reuse it. This is true with regards code in java and other programming languages, but there is no reason or the same thing not to apply to HTML.&lt;br /&gt;&lt;br /&gt;The problem I see is that, while graphical designers will be good at solving problems related to presenting data, they are not, by training or inclination, well suited towards &lt;em&gt;generalizing&lt;/em&gt; their solutions in a reusable way. But I also do not think that the hard-core java programmers are typically very inclined to invest their time in this. Well, if it so happens that we are talking about a common core kind of problem and neither designers nor programmers are typically going to address it, then finally, it seems that there is a need to think in terms of a third kind of category -- a team memer who I shall refer to as a &quot;website integrator&quot;, One aspect of this person&#39;s work is that they are looking at how to encapsulate presentational elements in a reusable way. &lt;br /&gt;&lt;br /&gt;Let&#39;s consider this scenario: a corporation of a certain size has a very large web presence. This web presence developed in a chaotic way with different subdivisions investing in disparate web-based projects. Eventually, this entity wants to unify all those efforts and present a common corporate look-and-feel across the board. Ultimately, it seems to me that this would largely amount to having a set of common reusable building blocks; that would bring the twin benefit of avoiding superfluous repeated labor, and also that, reusing these building blocks would naturally tend to yield a certain consistency of look-and-feel across the various subsites that make up that entity&#39;s overall web presence.&lt;br /&gt;&lt;br /&gt;Probably most readers realize at this point that when I talk about corporations investing in reusable building blocks, I am thinking in terms of FreeMarker macro libraries. Of course I am. However, the comments are still of a general nature, where I am thinking that a templating technology -- FreeMarker or some alternative -- must have powerful enough macro capabilities to support building reusable components.&lt;br /&gt;&lt;br /&gt;This leads me to a basic itch I want to scratch. There is a kind of rhetoric about how a template language should be extremely simple. For example, simplicity (i.e. a lack of certain features) is frequently touted as a great feature of Jakarta Velocity. Now, I think that many perceptive people suspect that this is largely an attempt to justify the lack of ongoing development in that project. Certain needed features have never been added, and the simplicity rhetoric can be conveniently trotted out when people bring this up. However, whether the simplicity argument is made in entirely good faith or not, it is fallacious. But here is an interesting point: the fallacy is not readily obvious when you use the 2-way division of labor; in fact, it may largely be a result of taking that paradigm too seriously. The argument is basically that people who work on page templates are graphical designers, so the templates have to be dead simple... However, thinking in terms of the proposed 3-way division of labor, the underlying fallacy is immediately laid bare. Once you think that way, you see that the third category of team member, the website integrator, also works extensively with templates, and a person in that role really must have a template language with macro capabilities sufficiently powerful to build libraries of reusable components. And I think this corresponds to the intuition of people who are experienced in web-based development: in the general case, going beyond little toy projects, yes, you do need these more powerful macro capabilities. &lt;br /&gt;&lt;br /&gt;(The other way to deconstruct the fallacy, by the way, is to realize that it is based on extending a solid, sound idea in an unsound way. It is surely bad practice to put &lt;em&gt;application level logic&lt;/em&gt; in your page template -- an extreme example would be having your template make direct SQL queries against a database. That is a sound principle, so far so good. However, this gets extended in an unsound way to mean that all programmatic logic, even &lt;em&gt;that which pertains to presentation itself&lt;/em&gt;, such as reusing presentational elements should be avoided in page templates. And I think that is fallacious in a fairly obvious kind of way. But again, the 3-way division lays bare the fallacy where the 2-way paradigm does not.)&lt;br /&gt;&lt;br /&gt;As a closing note, I am well aware that in very many projects of a certain scale, the programmer and the page designer are frequently one and the same. Thus, many readers could well be thinking: I&#39;m not even managing to have the 2-way division of labor going, and here you are talking about a 3-way division!!!&lt;br /&gt;&lt;br /&gt;Well, fair enough, but I don&#39;t think it is exactly the point that you &lt;em&gt;must&lt;/em&gt; have such a division of labor. I am not saying that. Of course, in real life, even if it is hardly optimal, people will have to wear multiple hats and be jacks of all trades. However, even in such cases, maintaining a clear architectural separation between model and view and the separation of roles it implies is a useful organizational principle. So I would say that, similarly, in the 3-way paradigm, the java programmer, the designer, and the website integrator might all be the same person, or it might be that the programmer and website integrator are the same person, but the graphical designer is somebody different. I would say that, even if you don&#39;t manage to have the full division of labor because people have to wear more than one hat, it is still useful conceptually. In fact, currently I am tending towards the idea that the 3-way division of labor is essential for thinking sensibly about what tools like FreeMarker are about, and probably also web application frameworks. It seems to me that the 2-way division has lived past its usefulness and concentrating on it will lead to erroneous thinking.</content><link rel="related" href="ThreeWay" title="The Designer/Developer Division of Labor Revisited (Alternative Title: The Three-Way Manifesto)"/><link rel='replies' type='application/atom+xml' href='http://freemarker.blogspot.com/feeds/115271983040535993/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/22457957/115271983040535993' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/115271983040535993'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/115271983040535993'/><link rel='alternate' type='text/html' href='http://freemarker.blogspot.com/2006/07/designerdeveloper-division-of-labor.html' title='The Designer/Developer Division of Labor Revisited (Alternative Title: The Three-Way Manifesto)'/><author><name>Jonathan Revusky</name><uri>http://www.blogger.com/profile/14215082065572028879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22457957.post-114157888760649072</id><published>2006-03-05T18:04:00.000+01:00</published><updated>2006-03-05T18:19:00.550+01:00</updated><title type='text'>Musings about Competition, Ego, Open Source and specifically, the Webwork/Struts Merger</title><content type='html'>Recently I read &lt;a href=&quot;http://select.nytimes.com/gst/abstract.html?res=F50810F93A5A0C728EDDAB0894DE404482&quot; target=&quot;_other&quot;&gt;an interesting article in the New York Times&lt;/a&gt; about upper middle class parents from Asian countries who moved to the U.S. specifically so that their children could avoid the rigors of the highly competitive education system in their home countries. There is the feeling that that kind of pressure cooker system robs children of their childhood and teen years. They want their kids to get an education of course, but they also want them to have a normal childhood. &lt;br /&gt;&lt;br /&gt;The article had one ironic aspect, though. The Asians in the article were settling in areas that were known to have schools that were much more academically demanding than average. (These, by the way, were typically New York neighborhoods that historically, have been predominantly Jewish but now are becoming increasingly Asian.) The schools in these areas are much more competitive and demanding academically than the norm in the United States, but I infer that they are still a romp in the park compared to the schools these kids would attend in Japan, Korea, or Taiwan, say.&lt;br /&gt;&lt;br /&gt;Just how extreme the situation can be is, apparently, no joke. I remember reading elsewhere that the teen/youth suicide rate in Japan was alarmingly high. This is widely believed to be a side effect of subjecting young people to those kinds of extreme competitive pressures.&lt;br /&gt;&lt;br /&gt;There are liberal or progressive theories of educational reform that decry the role of competition; alternative schools have been set up that abolish tests and grades. Certainly, if an educational system could abolish competition for grades and be based instead on instilling in students a genuine love of learning for its own sake, this would be a wonderful thing.&lt;br /&gt;&lt;br /&gt;The problem is: how do you foster excellence in a non-competitive environment? If nobody set up competitions like the Olympic Games and so on, would anybody have ever bothered to run a mile in less than 4 minutes -- if they were running for the pure joy of running? Maybe that&#39;s not a great example, because I don&#39;t know how much of a loss that would be. However, the point stands that competitive situations are structured that way because they motivate people to give it their all.&lt;br /&gt;&lt;br /&gt;Now, getting back towards the topic at hand, it seems clear to me that the open-source software world is inherently competitive in nature. Software projects compete to provide the most compelling solution in their problem space. I believe that the competition can (and should) be one of good-natured rivalry, but the logic and structure of this is that it is a competition. It is very largely a healthy competitive spirit that motivates people to excel.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Ego is good?&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;In a related vein, people will recall that in the film &lt;a href=&quot;http://www.imdb.com/title/tt0094291/&quot; target=&quot;_other&quot;&gt;Wall Street&lt;/a&gt;, Gordon Gecko famously proclaimed: &quot;Greed is good&quot;. This was not an original idea. It is a re-expression of the belief that private vices can lead to public good. The magnate&#39;s desire to accumulate wealth is a basic motor that creates wealth for the society as a whole. I realize that there are a lot of caveats to this and I am reluctant to similarly proclaim: &quot;Ego is good.&quot; But the reader will have got the idea, I guess.&lt;br /&gt;&lt;br /&gt;Sanctimonious political correctness aside, I believe that everybody reading this knows, in their heart of hearts, that a driving force in open-source software development (and in countless other human endeavors) is ego. Narcissism even, if you will. When Muhammad Ali proclaimed &quot;I am the Greatest&quot; he was being outrageously egotistical and narcissistic but at least he was not being a bloody hypocrite about it. I think that was actually refreshing for a lot of people. (Of course, that kind of strutting display has become much more typical in sports, and is probably now just tiresome.) &lt;br /&gt;&lt;br /&gt;I would not attempt to deny that ego has been a factor in my work on FreeMarker and in other things that I have done. But that should not be a great revelation. I would say in passing that if a fellow open-source developer told me that ego was not at all a factor in what he did, this would cause me to distrust him; I would assume that he was being less than honest, possibly with himself.&lt;br /&gt;&lt;br /&gt;I mean, look, you have to have at least a &lt;i&gt;healthy&lt;/i&gt; ego to believe that you have something to offer in a field, that other people have presented a solution but you can improve on it. It takes some belief in oneself to go to the habitual places like usenet groups, javalobby and theserverside and such to announce your work to an audience of software development professionals. People who do this obviously have an ego.&lt;br /&gt;&lt;br /&gt;But here is a point about this: when you do this, you must believe that your work is competitive with the state of the art in its space. If there is some other tool that is so unambiguously superior to mine that everybody who uses my tool would be better off using that other tool, I am just wasting people&#39;s time. Ego must be tempered by realism; otherwise, it is just narcissistic behavior. If the developers of a tool do not have something to offer that is competitive in its space, that really should lead to a crisis, a moment of reckoning.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The Struts/Webwork Merger&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;It seems that such a moment of reckoning did occur with Apache Struts. In December 2005, it was announced that the Webwork and Struts community were &quot;merging&quot;. What this amounted to was that the the Webwork 2.2 codebase would be used as the starting point for the next generation of Struts, Struts Action Framework 2.  &lt;br /&gt;&lt;br /&gt;This whole thing came as quite a surprise to me. Not that it really affects me that much, as I don&#39;t actually use either tool. My only relationship to the whole thing is that FreeMarker is used quite extensively in Webwork 2.2. The Webwork lead developer, Patrick Lightbody, was a regular on the FreeMarker mailing lists in the latter half of 2005. (He no longer is. He left our community announcing in a huff that he was unsubscribing from our lists. This is clearly somewhat connected with the merger with Struts though it&#39;s a bit murky...)&lt;br /&gt;&lt;br /&gt;Now, one amazing aspect of this whole thing is that the Struts developers were simply admitting that their product, their community&#39;s work, was inferior. While I have misgivings, on which I shall elaborate below, about this &quot;merger&quot;, I  must give credit where credit is due. The main Struts developers were simply willing to swallow their pride and accept that Webwork was better. Thus, for reasons I outlined above, it simply did not make any sense to continue to promote Struts Classic when people would simply be better off using Webwork.&lt;br /&gt;&lt;br /&gt;Yes, the open-source world is competitive by nature, and the Struts people were admitting that they had lost the competition. For the Struts developers to recognize that their users would be better served by migrating to the heretofore competing project is quite admirable. &lt;br /&gt;&lt;br /&gt;But now for what I see as the negative aspects...&lt;br /&gt;&lt;br /&gt;First of all, Webwork being rechristed Struts TI or Struts something or other is a step that seems designed to mislead the casual observer about what actually happened. Any casual observer would surely assume that this product was the continuation of the Struts 1.x codebase and thus, built on the work of the Struts community. However, this is not the case. There was, &lt;i&gt;de facto&lt;/i&gt;, a technically-based competition between the Struts community and the webwork community to produce a better framework. The Webwork people won the competition. The Struts people conceded defeat. &lt;br /&gt;&lt;br /&gt;Now, competition is a brutal thing. When I started off this article mentioning the pressures put on these Asian schoolkids, it was not, in my mind, a totally off-topic meandering. Competition is brutal because for somebody to win, somebody else has to lose. And it&#39;s humiliating to lose, to the extent that some percentage of those kids actually take their own lives. Since competition is something so inherently hard, we tend to want to find mechanisms to soften things. An athlete who is gracious when he wins and when he loses is admired. This is a mark of maturity certainly, but don&#39;t believe that when a highly competitive champion athlete competes and loses, he sleeps well that night. Do not believe that when he smiles and congratulates the winner, that he is not hiding the hurt and shame he feels inside.&lt;br /&gt;&lt;br /&gt;I suspect that Niall (the Struts developer with whom I have been having some dialogue on this blog) may now want to jump in and say that my paradigm is wrong, that actually, in this case, &lt;i&gt;everybody&lt;/i&gt; won. I would hope though that you don&#39;t say this, Niall, because I&#39;m not having any of it. Patrick Lightbody even wrote a blog entry stating &quot;Struts really sucks&quot; and if that&#39;s not throwing down the gauntlet, what is? No, there was a technically based competition and you (I mean, the Struts people here) have conceded defeat.&lt;br /&gt;&lt;br /&gt;Now, competition is an ugly business, but if you are going to have a competition, it has to be clear who won and who lost. Because let&#39;s face it: otherwise, why would anybody bother? So here is what is probably the central objection I have:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;This Struts/Webwork merger is designed in such a way as to create a maximum of confusion about who won and who lost.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Actually, the more you look at it, the more ass backwards the whole thing seems. As of this writing, Webwork is one of the projects in the so-called Apache incubator. Webwork&#39;s &quot;champion and &quot;mentors&quot; are the principal Struts developers. I ask you: How can Don Brown and Ted Husted or any other of the principal Struts developers be the &quot;mentors&quot; of the Webwork people? They accepted that the Webwork people had actually won the technical competition. &lt;br /&gt;&lt;br /&gt;Do I sign up for tennis lessons with a teacher who I just defeated 6-0, 6-0 in a tennis match? &lt;br /&gt;&lt;br /&gt;One of the &quot;exit criteria&quot; by which Webwork will be admitted as an Apache project is demonstrating that they &quot;get&quot; the &quot;Apache way&quot;. Well, presumably the Struts project was being run in accordance with this &quot;Apache way&quot; yet the Webwork people defeated them in a technically based competition to produce the better framework. So isn&#39;t this ass-backwards? If you have a meritocracy where you judge by results, obviously Ted Husted and Don Brown should be trying to learn the &quot;Webwork way&quot; or the &quot;OpenSymphony way&quot; because that is the way that has proven more effective at developing a good framework.&lt;br /&gt;&lt;br /&gt;Now, I lurk on the Struts-devel mailing list, mostly just to see if templating issues come up. Some of what I see does amaze me. In &lt;a href=&quot;http://article.gmane.org/gmane.comp.jakarta.struts.devel/35592&quot; target=&quot;_other&quot;&gt;this mail&lt;/a&gt; Patrick is debating what is basically a second-order project management issue, whether to use email notifications or do things with an RSS feed. (Note that I actually don&#39;t have an opinion about this.) One Sean Schofield responded &lt;a href=&quot;http://article.gmane.org/gmane.comp.jakarta.struts.devel/35597&quot; target =&quot;_other&quot;&gt;here&lt;/a&gt; lecturing Patrick about how mailing lists are &quot;the Apache way&quot; and so on.&lt;br /&gt;&lt;br /&gt;The fact is that, given that the Struts people lost the technical competition with Webwork, the only sensible thing is for them to defer to Patrick and the other Webwork people on these issues. If I defeat Joe Blow 6-0, 6-0 in the tennis match, Joe Blow, if he has any sense should not be lecturing me about the &quot;Joe Blow Way&quot; to hit a backhand. That Patrick is able to restrain himself when somebody is lecturing him about &quot;the Apache Way&quot; in this spot shows that he is somebody quite characterologically different from me. I simply would not take such shit from people.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;What happens now?&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;I really don&#39;t know. Deep down, Patrick and the other Webwork people must know how absurd the whole situation is. They accept an absurd situation because they want more visibility for their work. I understand. But somehow, I do not think this collaboration is going to work out well. Or, at the very least, I see some rough sailing ahead. I mean, when you set up a situation based on premises that are so divergent from reality -- the people who won the technical competition accepting the people they defeated as their &quot;mentors&quot; -- something maybe has to give at some point. But I don&#39;t know for sure either. As Mark Twain (I think it was he) said, making predictions is a perilous business, especially about the future. (Predicting the past is a better bet.)&lt;br /&gt;&lt;br /&gt;Well, in closing, one does have to hand it to the Struts people, and ASF in general. You know, it is almost as if, in early 1945, the Germans had managed to convince the allies to unconditionally surrender.</content><link rel='replies' type='application/atom+xml' href='http://freemarker.blogspot.com/feeds/114157888760649072/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/22457957/114157888760649072' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/114157888760649072'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/114157888760649072'/><link rel='alternate' type='text/html' href='http://freemarker.blogspot.com/2006/03/musings-about-competition-ego-open.html' title='Musings about Competition, Ego, Open Source and specifically, the Webwork/Struts Merger'/><author><name>Jonathan Revusky</name><uri>http://www.blogger.com/profile/14215082065572028879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22457957.post-114098303077673152</id><published>2006-02-26T20:19:00.000+01:00</published><updated>2006-02-26T20:43:50.793+01:00</updated><title type='text'>Musings on Wikipedia and Open Source</title><content type='html'>Recently, I have been using &lt;a href=&quot;http://www.wikipedia.org/&quot; target=&quot;_other&quot;&gt;Wikipedia&lt;/a&gt; quite a bit. First off, let me say that Wikipedia really is a blast. It is informative, like a regular encyclopedia, but due to the fact that anybody can contribute, there is a lot of funky stuff there that would not be found in a conventional encyclopedia. Surfing wikipedia is just a whole lot of fun!&lt;br /&gt;&lt;br /&gt;Of course, a naysayer would likely interject at this point that if you want to have some fun, go to wikipedia, but if you want complete, reliable information, look at Britannica. I have to admit that this would also be my instinctive reaction. However, much to my surprise (and doubtless that of many other people) a &lt;a href=&quot;http://www.nature.com/news/2005/051212/multimedia/438900a_m1.html&quot; target=&quot;_other&quot;&gt;recent study&lt;/a&gt; that appeared in Nature magazine found that the accuracy of scientific articles was not significantly different in Wikipedia than in &lt;a href=&quot;http://www.eb.com/&quot; target=&quot;_other&quot;&gt;Encyclopedia Britannica&lt;/a&gt;. Here is an &lt;a href=&quot;http://news.bbc.co.uk/1/hi/technology/4530930.stm&quot; target=&quot;_other&quot;&gt;article&lt;/a&gt; on that.&lt;br /&gt;&lt;br /&gt;Now, aside from a few very specific topics, like java template engines, or preflop strategy in Omaha Holdem poker, and maybe a couple of other things, I am not really qualified to judge the quality of information in Wikipedia. On the other hand, I have noticed that most Wikipedia articles that I come across are fairly well written. I am sensitive to this and consider myself to be a fairly good judge of it.&lt;br /&gt;&lt;br /&gt;I have been thinking about various things regarding open source. It seems to me that Wikipedia&#39;s strengths (and weaknesses) as compared to a conventional encyclopedia are pretty much those of the open source development model as compared to conventional software development.&lt;br /&gt;&lt;br /&gt;One of the revolutionary aspects of free software is that it drastically reduces barriers to entry. Anybody who is interested and motivated can hack the source code. Similarly, anybody can contribute material to Wikipedia. It seems likely that a conventionally published reference book would have some advantage in quality over the wikipedia model. After all, there is a paid editorial staff that would do systematic fact checking and do some needed line editing and so on. However, the advantage of the wiki model is how flexible it is, how quickly it can admit new material and updates and improvements. For example, if a major scientific discovery is made in a field that invalidates previous theories, it is likely that a wiki-based encyclopedia would incorporate this information much more quickly than a conventional publication. So there is a clear trade-off. In a field as rapidly moving as java software, for example, you might well prefer an article about java development tools that is up-to-date but may contain some errors and bits of sloppy prose over a more polished article on the subject that is a couple of years out of date.&lt;br /&gt;&lt;br /&gt;Not long ago, I wrote a blog entry about the issues involved in (very) hypothetically joining Jakarta. Though I answered by way of a simile involving King Arthur and the Round Table, I think that the reasons I gave would be clear to anybody reading it. However, an aspect of this that I did not mention there was that I have gradually come to the conclusion that ASF&#39;s entire vision of the open source process is incorrect. Certainly, there are reasons to have severe doubts about it. In recent private correspondence, a java developer commented that, once you got beyond surface impressions and actually rooted around, one could see that over 90% of ASF projects were in some kind of state of hibernation or even severe abandonment. He worried that an open source project that he liked and used quite a bit was on the road to becoming an ASF project, and that this would likely be the kiss of death.&lt;br /&gt;&lt;br /&gt;I am not so familiar with that many ASF projects, so I cannot vouch for the 90% figure this person gave. However, I think it&#39;s clear that there is some kind of systemic problem. &lt;br /&gt;&lt;br /&gt;My considered view is that the root of the problem is that ASF wants to project a certain elitist idea, that becoming a committer on an ASF project is some kind of great honor. If you lurk on a given project&#39;s mailing list, you will on occasion see them announce, to great fanfare something like: &quot;John Jones has been accepted as a FooBar committer.&quot; This kind of thing has always caused me to roll my eyeballs. The subtext is a bit like so-and-so has been admitted as a high priest who may now enter the inner sanctum and touch the holy of holies (which is the code repository presumably.)&lt;br /&gt;&lt;br /&gt;So, until they admit you to the holy of holies, you are basically in some kind of supplicant position: &quot;Please sirs, will you look at my patch.&quot; And, of course, since the patch in question is typically something that only that person needs at this moment (or maybe other people need it but none of the committers do) what with one thing and another, they typically don&#39;t get around to looking at the guy&#39;s patch.&lt;br /&gt;&lt;br /&gt;Certainly, the FreeMarker project is not run this way. If somebody expresses some interest in hacking the code, I pretty much immediately offer to add them as a developer so that they can commit code. They are added with no great announcement or votes or fanfare. Note that no vetting has occurred here. I will typically have no objective proof of the person&#39;s abilities. It is enough for them to say that they are interested in doing something for me to provide CVS access. Basically, we simply assume that somebody is competent until proven otherwise. &lt;br /&gt;&lt;br /&gt;Now, as a practical matter, there is not really much problem with people then turning around and committing poor-quality code willy-nilly. Actually, nine times out of ten, somebody expresses interest in doing something and you give them r/w access to CVS and they just never do anything -- good or bad.&lt;br /&gt;&lt;br /&gt;So, people committing all kinds of poor quality code is not a common real-world problem. But it can occur. However, even when it does occur, how much of a problem is it? Somebody does something and you can see what they did and modify their work or completely roll it back. This is, in fact, the whole point of a versions repository, is it not? Since it is fairly easy to roll back the code to some previous known state, why should one be so conservative about letting people commit code?&lt;br /&gt;&lt;br /&gt;But again, I think the core problem with ASF is this underlying elitist idea. And I think it&#39;s wrong; open source is not elitist by nature. It&#39;s more like: &quot;If you can do something, then roll up your sleeves and get to it, let&#39;s see what you can do.&quot; In other words, a person is assumed to be competent until proven otherwise. The ASF approach seems, on the other hand, to assume that you are not competent to collaborate until somehow proven otherwise. What makes matters worse, though, is that it is not really obvious what people who become committers have done to prove their competence. It often seems to be more of a popularity contest with people voting +1 and so on. &lt;br /&gt;&lt;br /&gt;So, admittedly, another take on this is that the problem is perhaps not elitism per se, but elitism that is arbitrarily applied. If you&#39;re going to be elitist, you should at least have some &lt;i&gt;objective&lt;/i&gt; criteria.&lt;br /&gt;&lt;br /&gt;The other aspect of this that I think is quite worthy of comment and some analysis is that, as far as I can see, the projects that line up to join ASF are not doing so because they really believe that there is any &lt;i&gt;technical&lt;/i&gt; value in it. It is purely to leverage the Apache brand name and thus take advantage of those placement and visibility advantages. Now, if you look at the pages relating to the Apache incubator, they state the supposed technical advantages that getting in with ASF involves, access to world experts in specific domains, experts in running open source projects, etcetera. But again, I do not believe that the OSS projects that want to get on apache.org believe any of this. It&#39;s purely for the visibility. For example, when the Struts/Webwork merger was discussed on opensymphony.com forums, the argument used was that by merging with Struts, they would get WebWork&#39;s technical superiority along with Struts&#39;s &quot;community&quot;. I parsed &quot;community&quot; in this case to be code for the marketing advantages. (In general, &quot;community&quot; is a term that ASF people use frequently in an odd and somewhat mystical way.) &lt;br /&gt;&lt;br /&gt;I do not recall that anybody suggested that the Struts people had &lt;i&gt;anything&lt;/i&gt; to offer technically. Zero, zilch, squat. Of course, similarly, when Leos Literak asked me about the possibility of joining ASF, it was all about publicity, he never at any moment in the discussion suggested that ASF had anything to offer us on a technical level.&lt;br /&gt;&lt;br /&gt;Well, all of this does introduce a real element of moral hazard. If you join ASF purely because so many people believe in this &quot;Apache mystique&quot; (that you, yourself do not believe in) then you now have a vested interest in perpetuating said mystique, since, after all, your whole strategy was based on the continuation of this mystique. &lt;br /&gt;&lt;br /&gt;As a final note on this &quot;Apache mystique&quot;, if what my correspondent said, that over 90% of ASF projects are in a sad state of neglect, a great gap has opened up between hype and reality. A very huge gap indeed. Is such a situation sustainable long-term? You know , it may be analogous to what happens in a financial boom, where something like internet stocks, say, get priced at some level completely out of line with whatever real economic value these things have. Such booms ultimately lead to a day of reckoning, a crash. When exactly such a crash occurs is all in the sort of theory of tipping points, etcetera. Or maybe there won&#39;t be any such &quot;crash&quot;. Still, my sense of things is that this Apache mystique will ultimate end up being deflated significantly. &lt;br /&gt;&lt;br /&gt;Well, nothing is more humbling than trying to predict the future. I have no crystal ball. We shall see.</content><link rel='replies' type='application/atom+xml' href='http://freemarker.blogspot.com/feeds/114098303077673152/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/22457957/114098303077673152' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/114098303077673152'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/114098303077673152'/><link rel='alternate' type='text/html' href='http://freemarker.blogspot.com/2006/02/musings-on-wikipedia-and-open-source.html' title='Musings on Wikipedia and Open Source'/><author><name>Jonathan Revusky</name><uri>http://www.blogger.com/profile/14215082065572028879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22457957.post-114045291772789263</id><published>2006-02-20T17:24:00.000+01:00</published><updated>2006-12-09T20:26:53.483+01:00</updated><title type='text'>Getting back in the Groove</title><content type='html'>Over the last couple of years, I have been doing fairly little in software development. My main activity has been online poker. I see little reason to keep this much of a secret.&lt;br /&gt;&lt;br /&gt;Nonetheless the itch to do some coding has resurfaced (maybe it&#39;s in the blood, like a virus or something) and I decided to get back in the groove, as it were. Aside from getting more involved in FreeMarker again, I began writing some poker-related code. The current (still very green) state of things is on &lt;a href=&quot;http://sourceforge.net/projects/pokersim&quot; target=&quot;_other&quot;&gt;sourceforge.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Ruby&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;I originally decided to use the pokersim project as a basis to explore Ruby. So I started the pokersim code in Ruby and made very fast progress despite the huge holes in my knowledge of the language.&lt;br /&gt;&lt;br /&gt;At some point, however, I decided, on a whim, to port the code over to Java, to compare performance as well as certain code metrics. I&#39;ll cut to the chase quickly and say that the same code (algorithmically the same code, it&#39;s different code obviously) ran 10x faster in Java. To be fair, this is because of the advanced JIT technology in Java. If you run with the JIT compiler disabled, the interpreted Java bytecode runs approximately at the same speed as the Ruby code. I am not enough of a compiler wonk to know whether the Ruby bytecode is as optimizable in theory as the Java bytecode, or in other words, whether the kind of tricks that Hotspot and its brethren do could be replicated in the Ruby world. (Perhaps not, due to Ruby&#39;s much more dynamic nature, but I don&#39;t know for sure either.)&lt;br /&gt;&lt;br /&gt;In any case, I am really a practitioner in this field, not a theoretician, and I have to work with the tools available rather than theorize about what tools are possible. I wanted to write software that could generate a lot (like maybe some tens of thousands) of random poker deals and generate statistics. While, to be honest, I&#39;m still not sure about the exact application, it is clear that, while 2x or 3x difference might not be so dramatic, a 10-fold speed difference could make huge differences in the usability of any software that comes out of this.&lt;br /&gt;&lt;br /&gt;I decided to switch the project over to Java. If I take another run at Ruby, it will be when I have defined some project where I know performance is not critical. (Or it could be that, at some future point in time, Ruby performance will be much better.)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Java 1.5 and Generics&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;So now, rather than using pokersim as a testbed for learning Ruby, I decided to use it to explore new features in Java 1.5, in particular type-safe enums, generics, and so on.&lt;br /&gt;&lt;br /&gt;The type-safe enum introduced in java 1.5 is unreservedly wonderful. In 1999 or 2000 I remember writing a type-safe enum class that worked in a very similar way to the way java 1.5 enums work. However, it was not part of the language, so it was much much more awkward to use.&lt;br /&gt;&lt;br /&gt;I also started using the genericized containers in java.util.*. The main advantage of generics is notational convenience. The type-safety issue is mostly an ersatz problem. The reason is that you very rarely in my experience have a heterogeneous container anyway. For example, if the cards object below is a regular untyped ArrayList from pre-1.5 java, you might write something like:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;for (Iterator it = cards.iterator(); it.hasNext();) {&lt;br /&gt;   Card card = (Card) it.next();&lt;br /&gt;   ...&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The argument that the (Card) typecast is somehow unsafe is, to my mind, merely a theoretical argument. As a practical matter, the real problem with ungenericized code like that above is its extreme verbosity. In pokersim code, I have a Cards class which is basically a ArrayList&lt;card&gt; with a bunch of convenience routines.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public class Cards extends ArrayList&amp;lt;Card&amp;gt; {&lt;br /&gt;  ...&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;and now I can write instead:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;for (Card card : cards) {&lt;br /&gt;   ...&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;And of course, the card variable is already defined within the loop. The whole thing is much more pleasant. It is shorter to type, it is easier to read and see the intent. Since such loops occur all over the place in the code, it makes a huge difference to code readability. It is already not too much worse than python code such as:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;for card in cards :&lt;br /&gt;  ....&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The above is, I guess, notational nirvana. Is there any cleaner more economical way to express the idea that you are iterating over the elements in a container? The java code still has significant visual clutter, the ( and ) and { and }, delimiters that python does without. Python (and Ruby) are still much nicer languages to write (and read) code in. The generics in java 1.5 simply reduce the gap somewhat.&lt;br /&gt;&lt;br /&gt;But again, the practical advantage of the generics here is, in my view, entirely on a notational level. The type-safety argument that is often harped on when generics are discussed strikes me as mostly an ersatz issue. Code throwing ClassCastException when you cast taking them out of containers was never that much of a problem in pre-1.5 java code.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Eclipse&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Another thing in that I have started using the Eclipse IDE for my java coding. Even aside from the tool&#39;s intrinsic merits, simply the fact that my main FreeMarker collaborators (Attila, Daniel, Stephan) use Eclipse is a major consideration, and I had taken various runs at using it before. However, until now, I had never been able to keep using it. I always ended up switching back to using jEdit (along with certain key plugins like XRefactory and AntFarm) as well as a whole hodgepodge of little scripts I used from the command-line, using a lot of grep and find and so on. I actually recognized that this was a more retrograde approach, but I still abandoned Eclipse each time.&lt;br /&gt;&lt;br /&gt;But now I am using Eclipse and there is little likelihood that I am going back.&lt;br /&gt;&lt;br /&gt;Perhaps the main reason that I have moved to Eclipse this time for good (as compared to previous runs) is that I am running better hardware. I bought a new Dell Inspiron 9300 last September. My previous memories of using Eclipse were that it was just so monolithic and slow. Also, I am simply running the Windows XP that came with the Dell and in previous runs, I was running Eclipse on Linux, where Java is much less performant. In particular, memory usage was just frightening on linux.&lt;br /&gt;&lt;br /&gt;Eclipse itself may have got better as well, as well as the underlying JVM. But for whatever reasons, it was mainly that the thing was such a hog that, while recognizing the tool&#39;s virtues, I couldn&#39;t use it; it just drove me nuts.&lt;br /&gt;&lt;br /&gt;But that was then and this is now. Consider me an Eclipse convert. Eclipse is also a good argument for Java over Ruby or Python, say. I do not believe the latter have development environments that are comparable.</content><link rel='replies' type='application/atom+xml' href='http://freemarker.blogspot.com/feeds/114045291772789263/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/22457957/114045291772789263' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/114045291772789263'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/114045291772789263'/><link rel='alternate' type='text/html' href='http://freemarker.blogspot.com/2006/02/getting-back-in-groove.html' title='Getting back in the Groove'/><author><name>Jonathan Revusky</name><uri>http://www.blogger.com/profile/14215082065572028879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22457957.post-114016690057939378</id><published>2006-02-17T09:43:00.000+01:00</published><updated>2006-02-17T10:01:40.586+01:00</updated><title type='text'>Google doesn&#39;t index us...</title><content type='html'>Google doesn&#39;t index &lt;a href=&quot;http://freemarker.org&quot;&gt;freemarker.org&lt;/a&gt; for years, probably because of the domain name hijacking issue earlier, where someone has run a porn linkpark on that domain. So we didn&#39;t stopped using &lt;a href=&quot;http://freemarker.sourceforge.net&quot;&gt;freemarker.sourceforge.net&lt;/a&gt; since then, because that&#39;s at least indexed by google. But the google rank of a page is mostly calculated based on how many external links point to it. Since our official homepage is freemarker.org, most external links will use that domain name, hence those links  are all wasted as far as we are talking about google rank. Given that how critical factor google rank is for your visibility, I see this as a serious loss.</content><link rel='replies' type='application/atom+xml' href='http://freemarker.blogspot.com/feeds/114016690057939378/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/22457957/114016690057939378' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/114016690057939378'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/114016690057939378'/><link rel='alternate' type='text/html' href='http://freemarker.blogspot.com/2006/02/google-doesnt-index-us.html' title='Google doesn&#39;t index us...'/><author><name>Dániel Dékány</name><uri>http://www.blogger.com/profile/17125555435600828180</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22457957.post-114012469231846690</id><published>2006-02-16T22:10:00.000+01:00</published><updated>2006-12-22T07:25:57.436+01:00</updated><title type='text'>Some comments on joining Jakarta (or not)</title><content type='html'>A longtime FreeMarker user, Leos Literak, &lt;a  href=&quot;http://article.gmane.org/gmane.comp.web.freemarker.devel/5500&quot;&gt; asked &lt;/a&gt; on our mailing list about the possibility of our joining Jakarta/ASF. I figured that by answering on this blog rather than on the list, I could kill two birds with one stone -- I could answer him and inaugurate this blog with something (hopefully amusing) for people to read.&lt;br /&gt;&lt;br /&gt;I guess Leos knows that such a move is highly unlikely, if only on account of the less than cordial relations that some of us have with some of the Jakarta/ASF people. But that is only part of it, at least speaking for myself. Other FreeMarker developers may not share my views (or share them partially with some nuances.) But in any  case, I am only speaking for myself.&lt;br /&gt;&lt;br /&gt;Okay, I shall assume that the reader is familiar with the Arthurian legends (you know, Camelot, Excalibur, the Round Table) through one or more of its literary, or more likely, cinematographic adaptations. Let us say that I am a knight of that time period, known for certain knightly deeds. It is proposed that I should try to become admitted to the Round Table, to become one of the famed Knights of the Round Table.&lt;br /&gt;&lt;br /&gt;I have to admit that the idea has certain appealing aspects. You see, there is a whole mystique around the Round Table. This is mainly because there is a whole legion of wandering troubadours who go about the land singing epic songs about their heroic exploits. This has a lot of advantages. It seems that if you are a Knight of the Round Table, you are given the choicest morsels at feasts. When you show up somewhere, they break out the best wines and spirits to celebrate that such a hero is gracing their presence. The fairest maidens of the land fall at your feet.&lt;br /&gt;&lt;br /&gt;So it would seem to be an easy decision. However, there is a dark side to all of this. You see, suppose that you happen to know that the Round Table mystique is based on quite little. On the contrary, these Knights of the Round Table are, in reality, quite the motley crew. Some are not such bad fellows, but many others are thugs and cutthroats and others are cowardly bullies. To your mind, King Arthur himself is no more admirable than any other mafia boss trying to expand his territory. (As a side note, while I grant that I was not there, this version of things strikes me as being at least as likely to be true as the legends.)&lt;br /&gt;&lt;br /&gt;Suppose that I don&#39;t accept Arthur as a legitimate king. (For example, I happen to know for a fact that when he pulled the sword out of the stone, it was a cheap sleight of hand trick.) However, to become a Knight of the Round Table, I must kneel before him and accept him as my sovereign. I will probably also have to retract any prior statements I made about the supposed exploits of the Knights of the Round Table. I would now have to toe the party line (sorry for the mixed metaphors...) regarding the heroic exploits of my colleagues of the Round Table. (Actually, for an example of this, see &lt;a href=&quot;http://article.gmane.org/gmane.comp.jakarta.struts.devel/34927&quot;&gt;here&lt;/a&gt;.) &lt;br /&gt;&lt;br /&gt;Well, in summary, like any decision it would have its pros and cons to weigh. The pros mainly involve all the troubadours wandering about singing your praises. (I guess the modern equivalent is all the computer magazines and the various people who write O&#39;Reilly books about any load of horse manure that ASF tosses over the fence...) The cons involve compromising one&#39;s integrity by accepting illegitimate authority, and also having to be nice and behave respectfully to people you don&#39;t particularly like or respect.&lt;br /&gt;&lt;br /&gt;I guess the reader has already inferred that, for me, given my characterological makeup, the cons outweigh the pros -- to an extent that it is basically unthinkable.&lt;br /&gt;&lt;br /&gt;All of that said, I can respect that other people would see things differently. Certainly, many other open source projects are extremely eager to become ASF projects and I can respect their reasons. It may well be a weakness of overweened pride on my part that I am not willing to kowtow to authority that I perceive to be illegitimate. It certainly is not particularly pragmatic.</content><link rel='replies' type='application/atom+xml' href='http://freemarker.blogspot.com/feeds/114012469231846690/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/22457957/114012469231846690' title='31 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/114012469231846690'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/114012469231846690'/><link rel='alternate' type='text/html' href='http://freemarker.blogspot.com/2006/02/some-comments-on-joining-jakarta-or.html' title='Some comments on joining Jakarta (or not)'/><author><name>Jonathan Revusky</name><uri>http://www.blogger.com/profile/14215082065572028879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>31</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22457957.post-113994917021476070</id><published>2006-02-14T21:17:00.000+01:00</published><updated>2006-02-15T11:30:19.436+01:00</updated><title type='text'>Feature in spotlight: Error reporting</title><content type='html'>Max Rydahl Andersen, a Hibernate developer tells us &lt;a href=&quot;http://blog.hibernate.org/cgi-bin/blosxom.cgi/2006/02/03#a_story_about_freemarker_and_velocity&quot;&gt;&quot;A story about FreeMarker and Velocity&quot;&lt;/a&gt; on the Hibernate groupblog. It is later covered on &lt;a href=&quot;http://www.theserverside.com/news/thread.tss?thread_id=38869&quot;&gt;TheServerSide.com&lt;/a&gt; as well. Looks like that the one feature among all things that particularly convinced Max to abandon Velocity and start using FreeMarker was - drumroll - error reporting. Now, error reporting is not a functionality that&#39;s usually prominently displayed on a product&#39;s feature sheet, yet if done right it is invaluable for time efficient problem solving when things go wrong. &lt;br /&gt;&lt;br /&gt;So, what&#39;s it all about? &lt;br /&gt;&lt;br /&gt;Well, it works like this: when FreeMarker encounters an error, it&#39;ll not only pinpoint the exact column and line where the error occurred, but it will display a full template stack trace containing all macro invocations and includes that led to the point of exception. To illustrate it with an example, consider we have two templates, a.ftl and b.ftl:&lt;br /&gt;&lt;br /&gt;a.ftl:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;#include &quot;b.ftl&quot;/&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;b.ftl:&lt;br /&gt;&lt;pre&gt; &lt;br /&gt;&amp;lt;#macro printFoo y&gt; &lt;br /&gt;${y.foo} &lt;br /&gt;&amp;lt;/#macro&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;@printFoo bar/&gt; &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Then you&#39;ll see this output (assuming your error was that &quot;bar&quot; is a simple string instead of a hash): &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Expected hash. y evaluated instead to freemarker.template.SimpleScalar&lt;br /&gt;on line 2, column 3 in b.ftl. &lt;br /&gt;Quoting problematic instruction: &lt;br /&gt;---------- &lt;br /&gt;==&gt; ${y.foo} [on line 2, column 1 in b.ftl] &lt;br /&gt;in user-directive printFoo [on line 5, column 1 in b.ftl] &lt;br /&gt;in include &quot;b.ftl&quot; [on line 1, column 1 in a.ftl] &lt;br /&gt;---------- &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;So you can see precisely what template execution path led to the error - invaluable to figure out what&#39;s going on when you can have macros and includes invoked from multiple locations.</content><link rel='replies' type='application/atom+xml' href='http://freemarker.blogspot.com/feeds/113994917021476070/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/22457957/113994917021476070' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/113994917021476070'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22457957/posts/default/113994917021476070'/><link rel='alternate' type='text/html' href='http://freemarker.blogspot.com/2006/02/feature-in-spotlight-error-reporting.html' title='Feature in spotlight: Error reporting'/><author><name>Attila Szegedi</name><uri>http://www.blogger.com/profile/11586966395114113526</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry></feed>