[stringtemplate-interest] On Pragmatism Violating Purity For The Win
Jonathan Buhacoff
jonathan at buhacoff.net
Mon Oct 19 22:20:04 PDT 2009
>
> We all believe ST's purity is valuable, but if many people can't use
> ST, who cares? I believe purist inflexibility is hurting ST for
> some projects and crimping its growth. I believe something like
> "model.*" addresses critical ST adoption issues and makes ST more
> accessible, flexible, and relevant to more projects.
>
Here's my take, for what it's worth:
The world already has enough text generation systems without a strict
separation between model and view. It doesn't need another one.
I believe that ST's growth in popularity will be precisely because it
maintains a strict separation that attracts programmers who are
suffering from spaghetti-code syndrome with other tools.
At any rate, that's why I enjoy using ST, and I know that I can
completely swap out the model if I want to. That's won't easy to do
if litter my templates language-specific "hooks". I like ST because
it prevents me from doing what I'll regret later. Contrast with JSP,
Velocity, Text::Template, and others for which it's not possible to
change the model.
If the strict separation & the convenient functional syntax makes ST
good -- then giving that up for the sake of making ST popular will
make it less good.
Everything that needs to be done to "massage" data can be done and
should be done in the model. Employ whatever middleware you like --
in the model. It will be a lot more powerful there.
ST does have nice convenience features for pushing objects directly to
the view (so you don't have to copy all their properties to a map) and
of course you can abuse these with side-effect programming... but that
would be abuse of a feature, as opposed to something built-in to
encourage entanglement of model and view.
I think it's fine if ST is less popular, as long as it stays the most
useful :)
Jonathan
> Cheers,
>
> = Joe =
>
> _______________________________________________
> stringtemplate-interest mailing list
> stringtemplate-interest at antlr.org
> http://www.antlr.org/mailman/listinfo/stringtemplate-interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/stringtemplate-interest/attachments/20091019/388d192f/attachment.html
More information about the stringtemplate-interest
mailing list