The Artima Developer Community
Sponsored Link

Weblogs Forum
What Do You Look For in a Template Engine?

69 replies on 5 pages. Most recent reply: Aug 16, 2007 8:44 PM by Frederick Sickert

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 69 replies on 5 pages [ « | 1 2 3 4 5 | » ]
Eelco Hillenius

Posts: 37
Nickname: ehillenius
Registered: Mar, 2006

Re: What Do You Look For in a Template Engine? Posted: Jul 24, 2007 8:12 PM
Reply to this message Reply
Advertisement
> Don't go around pretending that you read whatever it is and seriously thought about it when you darned well didn't, okay?

I read the article, and I have nothing but my word to prove that.

> "I read through it and didn't quite understand what point you were making as regards this conversation. Could you clarify that?"

Yes. But as you've been obnoxious from your very first reply, I kind of lost the appetite. Of course, I should have.

> I cannot easily imagine myself saying "I tried to read X" with the intent of conveying the idea that I had actually read it.

I figure you thought my browser crashed?

> > For example, in a recent response, you wrote:
>
> "We seem to have a difference of opinion in what we label "designers". Your's seem to be programmers in disguise."

Yes, in the context of your article, and presuming I would agree this distinction matters: I should have said 'website integrators', but...

> In fact, if you had read the article, you would surely understand that I was proposing a third role precisely because I was assuming more programming abilities on the part of the non-java types than might be reasonable if we considered them to be pure graphical designers. That was what the "website integrator" idea was.

in the context of this thread and from reasoning of presentation vs logic this would be the same thing, namely someone working on the templates (be it directly or indirectly).

> So, this has been said (I infer many times) before. Could you provide me the links?

Ok, let me get this straight. When I'm saying whether I doubt something is common knowledge you defend that by giving some story about how many people supposedly believe the world is flat, and now you want me to browse around and find links for something that I consider common sense?

I based my statement on experience working in teams, talking on mailing lists, IRC channels etc. I thought it was pretty clear there are often roles in between, whether on the web tier or in other areas. In my experience, what you call 'web integrator' is typicaly filled in by junior programmers or designers who don't mind to do some programming as well. I didn't exactly try to verify whether this was a verifyable common conception, but try googling with a few keywords (like "separation designer programmer blurry" or something) and you'll find plenty of results.

> In the above, I am not proposing a different kind of social and economic organization, I am simply saying that the 2-way paradigm is not sufficient and it may be better to think in terms of 3 basic roles. The article does not propose a specific methodology actually.

Your posts are full of logic falicies. Hasty generalizations, false anologies, false dilemmas, forcing your opinions through the troath by repeating it over and over again... It would be really helpful if you would just stick to plain reasoning and shorter replies if you can. Not that it matters much for this thread, as I've got a strong feeling that most people don't even get this far reading.

Eelco Hillenius

Posts: 37
Nickname: ehillenius
Registered: Mar, 2006

Re: What Do You Look For in a Template Engine? Posted: Jul 24, 2007 9:08 PM
Reply to this message Reply
> Okay, fine, but do you want SoC for its own sake,

No, but I don't want to follow your very particular intepretation either.

> because it's just something theoretically "good" or is it for the pragmatic reason that it allows different people to work on different pieces of something and (to a maximal extent reasonable) avoid stepping on each other's toes?

I'm all for pragmatism. But there's different flavors of that. JSP scriptlets for instance are arguably pragmatic. Sometimes it is very hard to do things using just tag libraries. Still, you can say that it is bad that this particular pragmatism exists, as it is too easy for people to dig holes for themselves. I don't think stating that is dogmatic.

> > One possible way of applying seperation of concerns is to make a distinction between presentation (1) and logic (2).
> No, it's not, because presentation, in the general case, requires some amount of programmatic logic. A distinction between presentation logic and business logic makes sense, but you can't have a distinction between presentation and logic generally when presentation inherently contains logical elements.

You can very well make the distinction between static parts of your presentation and dynamical parts. I'm talking about separation of the UI layer itself.

> And, generally speaking, shouldn't these concepts like model-view separation really be pragmatic guidelines rather than some kind of dogmatic thing to beat people over the head with?

Why is it dogmatic to make clear choices? Is data hiding and access control dogmatic? Is enforcing a certain pattern in a framework to guide your users to use the framework in the way you (as the framework author) dogmatic?

> I am quite satisfied that, in the real world, where people solve real problems, there is a need for a powerful template engine along the lines of freemarker. This dogma, where you espouse the idea that you can remove all programmatic logic from the view (and I mean logic that inherently pertains to presentation) is just that, a dogma. It is quite revealing when you say accusingly that my arguments are all "just" practical arguments...

I used 'purely practical', as you mentioned that while you believe a strict separation is a good thing, it is not practical.

As you understand by now, I think it *is* achievable while still being practical. I would like to go even further than that, and say that I believe it is *preferable* to have this separation. That doesn't mean all other approaches are wrong. It means I think there are advantages to having this separation that can - depending on the context you work in - outweight the disadvantages.

> However, surely the team is more productive if you can at least minimize the need for the people working on the web side to come talk to the java programmers when they need to do something, like display a distance or temperature in different units (which is just one example I provided, there are many more...)

Well, that just depends. I have to say I don't find the case of where you develop a site, and then later pull a copy of that site and localize that just using your designers and 'website integrators' (and deploy it as a seperate instance?) very convincing. If it were up to me, I'd avoid branching the site and localize it using the whole team, put it through the develop/test/deploy cycle and deploy it on shared infrastructure if that's an option.

In the same sense, I'm not crazy about the idea of the designers and/ or 'website integrators' just tweaking templates without creating a whole new build. I know there are people out there that are even ready to tweak templates directly on production sites and call that pragramatic, but that wouldn't be my choice. Especially nowadays, when you can create whole new builds in a few seconds with a single command and can automate (much of) the deployment through the pipeline.

> Well, nobody is forcing you to continue to write such muddle-headed posts., full of logical fallacies. However, if you do so, I think it quite improper for you to whine when I (or anybody else) carefully deconstructs the logical fallacies you're engaging in.

What annoys me is exactly that: your way of using logical fallacies in your discussions. Not to mention you deem it necessary to use emotionally charged expressions all over the place.

Jonathan Revusky

Posts: 19
Nickname: revusky
Registered: Jul, 2007

Re: What Do You Look For in a Template Engine? Posted: Jul 24, 2007 9:22 PM
Reply to this message Reply
> > Don't go around pretending that you read whatever it is
> and seriously thought about it when you darned well
> didn't, okay?
>
> I read the article, and I have nothing but my word to
> prove that.

<sigh>

I probably should pretend that I believe you, that I take your word for it, but I'm not going to do that. I just cannot bring myself to believe that anybody, when somebody casts doubt one whether they actually read something when, in fact, they did, would say "I tried to read it". I mean, that just too clearly implies that they didn't really read it.

>
> > "I read through it and didn't quite understand what
> point you were making as regards this conversation. Could
> you clarify that?"
>
> Yes. But as you've been obnoxious from your very first
> reply, I kind of lost the appetite. Of course, I should
> have.

Right, so your pretending that you read something and understood the points being made is my fault, because I'm such an obnoxious guy. Fine, okay.

>
> > I cannot easily imagine myself saying "I tried to read
> X" with the intent of conveying the idea that I had
> actually read it.
>
> I figure you thought my browser crashed?


What I believe is that when you said "I tried to read it" you slipped up, because you were telling the truth, that you started reading it and it got to be heavy going, and you stopped in the middle or something. However, when you realized how damning it was that you had clearly represented that you had read the, you decided to argue that there was sarcasm there and "I tried to read it" really meant that you had read it. And so on and so forth... <sigh>

>
> > > For example, in a recent response, you wrote:
> >
> > "We seem to have a difference of opinion in what we
> label "designers". Your's seem to be programmers in
> disguise."
>
> Yes, in the context of your article, and presuming I would
> agree this distinction matters: I should have said
> 'website integrators', but...

But what? I clearly suggested a need to consider a third role. If you'd read the article, you'd surely not be suggesting that I was saying that designers encapsulate reusable presentation logic in templates. I suggested a third role for that that is not exactly the back-end programmer or the graphical designer.

I mean, independently of whether you agree with my main point or not, does it make sense to respond to what somebody said by abstracting away that person's central point? (Of course, there is a simple explanation for this. You didn't know what the central point was because you didn't read the article. At least not completely...)

>
> > In fact, if you had read the article, you would surely
> understand that I was proposing a third role precisely
> because I was assuming more programming abilities on the
> part of the non-java types than might be reasonable if we
> considered them to be pure graphical designers. That was
> what the "website integrator" idea was.
>
> in the context of this thread and from reasoning of
> presentation vs logic this would be the same thing, namely
> someone working on the templates (be it directly or
> indirectly).

Yes, in the paradigm of the article, a website integrator would be working on templates, very largely on macro libraries. that encapsulate reusable elements.

>
> > So, this has been said (I infer many times) before.
> Could you provide me the links?
>
> Ok, let me get this straight. When I'm saying whether I
> doubt something is common knowledge you defend that by
> giving some story about how many people supposedly believe
> the world is flat,

Look, for starters, every web framework and its uncle claims to promote an MVC architecture, doesn't it? So that some sort of model view separation of concerns is conventional wisdom at this point is a reasonable conjecture. The point about the world being flat is that, sure, there are people who still haven't got that message even, but actually, it is common knowledge that the world is round.

> and now you want me to browse around
> and find links for something that I consider common
> sense?

Well, you were suggesting that the article I wrote did not contain any original ideas. Well, fine, you definitely could be right about that. So, okay, maybe my ideas there are not original. That doesn't bother me too much. However, if they aren't original, then they were stated already elsewhere, right? So naturally I ask you where. Now you're feigning that you find this unreasonable.

But no, I'm not the person being unreasonable. You are, you're making a claim and expressing surprise when I ask you to back up the claim.


>
> I based my statement on experience working in teams,
> talking on mailing lists, IRC channels etc. I thought it
> was pretty clear there are often roles in between, whether
> on the web tier or in other areas. In my experience, what
> you call 'web integrator' is typicaly filled in by junior
> programmers or designers who don't mind to do some
> programming as well. I didn't exactly try to verify
> whether this was a verifyable common conception, but try
> googling with a few keywords (like "separation designer
> programmer blurry" or something) and you'll find plenty of
> results.

Well, of course, if the role exists, as I claim it does, then, whether people are aware of it, somebody has to do that work, right? So, like it or not, what you're saying above actually fits perfectly well with what I'm saying.

However, if there is the third role, most people who talk about web development, for whatever reason, talk in terms of two basic roles.

Another point I would make is that you talk of the website integrator as a junior developer -- in other words, it's not really a recognized role, and one would infer that it is considered some low-status thing that you have some less able programmer do, because, like, well, maybe you don't really want him in the java code, and you realize that there are these other tasks in the gray zone there, so you set him to do that.

However, if that is the case, is it really an optimal situation? Maybe that third role that I have called "website integrator" should be considered a respectable professional specialty in itself and you'll get better results. Maybe, I say, because I don't know for sure, I'm just throwing out some ideas here.

So, I mean, I am throwing out some ideas that, I'm pretty sure, could at least provide the basis for a discussion. It is highly frustrating when people pretend that they are seriously considering the ideas and then, when pressed, admit they never read the article and then rectify claiming that when they said basically that they didn't read it, it was obvious sarcasm and really they did.... and blah blah blah

Look, if you want to stop all the clownish pretending and have a real conversation, I am up to it, and I won't harp on the water under the bridge.

>
> > In the above, I am not proposing a different kind of
> social and economic organization, I am simply saying that
> the 2-way paradigm is not sufficient and it may be better
> to think in terms of 3 basic roles. The article does not
> propose a specific methodology actually.
>
> Your posts are full of logic falicies.

Look, this is just getting to be really really realy annoying. This utterly pathetic childish posturing.... Look, isn't it perfectly obvious that if if you could deconstruct any logical fallacy I was engaging in, you would have done so?

But you do not do so.

Why?

Because you cannot.

> Hasty
> generalizations, false anologies, false dilemmas, forcing
> your opinions through the troath by repeating it over and
> over again...

Well, repeating yourself is not a logical fallacy. As for the other ones, like false analogies, do provide at least one example, won't you?

Or is this me being unreasonable again, seriously suggesting that you should back up statements that you make... (Heck, this it the internet... maybe it is unreasonable of me...:-))

> It would be really helpful if you would just
> stick to plain reasoning and shorter replies if you can.
> Not that it matters much for this thread, as I've got a
> strong feeling that most people don't even get this far
> reading.

Well, that I don't know. If I were you, I would certainly hope nobody was reading this. :-(

Now, here is a question for you:

What is your position on presentational logic? I see two possibilities from what you have said:

(a) There is no such thing, presentation and logic are two separate dichotomous things.

(b) Yes, there is such a thing, but since presentational logic is logic, it doesn't belong on the template layer and should be in the java code.

I see (a) and (b) as two basic logical possibilities for you. In passing, it seems that the original poster, Frank Sommers, does believe that there is such a thing as presentational logic. I infer that from the second sentence of the article: "Presentational logic can be complex enough...."

Jonathan Revusky

Posts: 19
Nickname: revusky
Registered: Jul, 2007

Re: What Do You Look For in a Template Engine? Posted: Jul 24, 2007 10:44 PM
Reply to this message Reply
> > Okay, fine, but do you want SoC for its own sake,
>
> No, but I don't want to follow your very particular
> intepretation either.

I do not recall ever providing my own personal interpretation of what the term means.

AFAICS, SoC is about the ability to partition a problem. And, actually, come to think of it, I don't quite know why you would react negatively to my three-way paradigm. If partitioning the problem 2-ways is good, then partitioning it 3 ways is arguably even better, right?

>
> > because it's just something theoretically "good" or is
> it for the pragmatic reason that it allows different
> people to work on different pieces of something and (to a
> maximal extent reasonable) avoid stepping on each other's
> toes?
>
> I'm all for pragmatism. But there's different flavors of
> that. JSP scriptlets for instance are arguably pragmatic.
> Sometimes it is very hard to do things using just tag
> libraries. Still, you can say that it is bad that this
> particular pragmatism exists, as it is too easy for people
> to dig holes for themselves. I don't think stating that is
> dogmatic.

Well, if you believe that everybody is out to get you, and in fact they are, I suppose that's arguably not paranoia. At least it's no longer a paranoid delusion, which is what is usually meant, right?

If you're dogmatic about something, i.e. you firmly believe it, and what you believe is actually true, then, well, that's similar, I guess. AFAICS, the problem is obviously when you adhere to something dogmatically and it's actually not true -- at least not in the general case.

The basic problem that I find in what you are saying is the idea that having logic (even presentational logic) in your template is a no-no, yet you see no problem w.r.t. SoC in having such presentational logic in your java code. It seems to me that there is clearly some disconnect there.

> > > One possible way of applying seperation of concerns is
> to make a distinction between presentation (1) and logic
> (2).
> > No, it's not, because presentation, in the general case,
> requires some amount of programmatic logic. A distinction
> between presentation logic and business logic makes sense,
> but you can't have a distinction between presentation and
> logic generally when presentation inherently contains
> logical elements.
>
> You can very well make the distinction between static
> parts of your presentation and dynamical parts. I'm
> talking about separation of the UI layer itself.

I can't quite parse what you say there. I assume we're talking about parts that are at least somewhat dynamic because there is no issue wrt putting static parts of your presentation anywhere but in the template. That's a non-issue.

>
> > And, generally speaking, shouldn't these concepts like
> model-view separation really be pragmatic guidelines
> rather than some kind of dogmatic thing to beat people
> over the head with?
>
> Why is it dogmatic to make clear choices? Is data hiding
> and access control dogmatic? Is enforcing a certain
> pattern in a framework to guide your users to use the
> framework in the way you (as the framework author)
> dogmatic?

Well, as I said above, I guess the problem is when the dogma is mistaken. :-)

>
> > I am quite satisfied that, in the real world, where
> people solve real problems, there is a need for a powerful
> template engine along the lines of freemarker. This dogma,
> where you espouse the idea that you can remove all
> programmatic logic from the view (and I mean logic that
> inherently pertains to presentation) is just that, a
> dogma. It is quite revealing when you say accusingly that
> my arguments are all "just" practical arguments...
>
> I used 'purely practical', as you mentioned that while you
> believe a strict separation is a good thing, it is not
> practical.


I never said exactly that, I don't think.

Basically, my sense of things is that I also believe that model-view separation of concerns is desirable. It's that I differ with you on what that model-view separation means. My take on this is that you (and Geert Bevin) have somehow become committed to some extreme and IMO misguided interpretation of it -- the idea that templates should contain no programmatic logic, even programmatic logic that clearly relates to presentation.

>
> As you understand by now, I think it *is* achievable while
> still being practical. I would like to go even further
> than that, and say that I believe it is *preferable* to
> have this separation. That doesn't mean all other
> approaches are wrong. It means I think there are
> advantages to having this separation that can - depending
> on the context you work in - outweight the disadvantages.

Okay, what are the advantages to having presentation logic in java code as opposed to using macros in a more powerful template language like FreeMarker?

>
> > However, surely the team is more productive if you can
> at least minimize the need for the people working on the
> web side to come talk to the java programmers when they
> need to do something, like display a distance or
> temperature in different units (which is just one example
> I provided, there are many more...)
>
> Well, that just depends. I have to say I don't find the
> case of where you develop a site, and then later pull a
> copy of that site and localize that just using your
> designers and 'website integrators' (and deploy it as a
> seperate instance?) very convincing.

Why not? Because they don't need you? :-)

>If it were up to me,
> I'd avoid branching the site and localize it using the
> whole team, put it through the develop/test/deploy cycle
> and deploy it on shared infrastructure if that's an
> option.

Well, but maybe it's not an option.

>
> In the same sense, I'm not crazy about the idea of the
> designers and/ or 'website integrators' just tweaking
> templates without creating a whole new build.

Well, I guess the people who created Windoze had a similar sort of mindset. They apparently aren't crazy about people installing or upgrading their apps without rebooting the OS.

OTOH, if the OS were properly designed, it ought to be possible to do so, and if it is possible, why should people have to reboot the OS after upgrading some app?

Similarly, why should people have to rebuild or even restart some web app just because they tweaked a few templates?

I mean, frankly, the things you say just start amazing me to an increasing extent...

> I know there
> are people out there that are even ready to tweak
> templates directly on production sites and call that
> pragramatic, but that wouldn't be my choice. Especially
> nowadays, when you can create whole new builds in a few
> seconds with a single command and can automate (much of)
> the deployment through the pipeline.

Well, you can create new builds, I guess. But not everybody who just tweaked a template is in a position to rebuild or even restart the app. It is beyond me why you think that should be necessary anyway.

>
> > Well, nobody is forcing you to continue to write such
> muddle-headed posts., full of logical fallacies. However,
> if you do so, I think it quite improper for you to whine
> when I (or anybody else) carefully deconstructs the
> logical fallacies you're engaging in.
>
> What annoys me is exactly that: your way of using logical
> fallacies in your discussions.

Could you outline some logical fallacy that I have used?

C'mon, surely if you could do so, you would have done it by now, no?

Why keep claiming things that you have not the slightest intention of backing up? I really find that kind of thing insufferable.


> Not to mention you deem it
> necessary to use emotionally charged expressions all over
> the place.

Well, I have already said that I find a lot of your behavior in this discussion rather annoying and I have explained why. So, it's just that I am not making any particular effort to conceal that annoyance. Maybe you should refrain from the annoying behaviors, like only state things that you are willing to back up with facts or logical debate. And basically, just refrain from the A-1-A annoying pussy behavior of saying "I don't need to respond to Revusky's arguments because Revusky is so annoying." I mean that's such a lame cop-out....

Eelco Hillenius

Posts: 37
Nickname: ehillenius
Registered: Mar, 2006

Re: What Do You Look For in a Template Engine? Posted: Jul 24, 2007 11:50 PM
Reply to this message Reply
> I probably should pretend that I believe you, that I take your word for it, but I'm not going to do that. I just cannot bring myself to believe that anybody, when somebody casts doubt one whether they actually read something when, in fact, they did, would say "I tried to read it". I mean, that just too clearly implies that they didn't really read it.

I tried to explain that this wasn't a slip, but my way of being sarcastic. You keep repeating your interpretation of the scentence that I wrote, and you think to back that up with 'proof' coming from my replies, which in fact *you* don't seem to understand.

> > Your posts are full of logic falicies.
>
> Look, this is just getting to be really really realy annoying. This utterly pathetic childish posturing....

Yes, very. I wish you'd stop it.

A few examples:

> 'The conventional wisdom floating around...'

> '... since that clearly does violate separation of concerns'

> ' I am not Einstein, but I am reasonably on the ball by most standards. It is quite unwise to dismiss my observations on this topic out of hand. It really is....'

> 'Anybody who was not born yesterday can see that you do not respond to me with legitimating debating points because you cannot...'

> 'If I said (I don't know whether I said it, but I'll say it now) that you or Eelco do not really understand the separation of roles concept, it is because I honestly believe that you don't...'

> 'I don't know if it was only me that the sarcasm was lost on.'

> 'I cannot easily imagine myself saying "I tried to read X" with the intent of conveying the idea that I had actually read it...'

> 'When you said you tried to read it, it was like a Freudian slip, because it really meant you hadn't read it...'

> 'A smoker will tell me that there is no point in his stopping smoking because he could still get cancer even if he stops smoking...'

> 'Just as it's impossible to follow Mark Twain's (joking) investment advice, because you don't know for sure whether the stock is going up or not, your advice on this cannot be followed in the general case, because it is impossible to anticipate all the different ways in which you might want to display data in the view...'

> 'Similarly, the atheist's firm belief that there is no God is in fact a religious belief...'

> 'as if some people come at you with some simplistic marxism and say that society is made up of two groups, the capitalists (the exploiters) and the workers (the exploited) and that's how you think about it...'

> 'Well, it depends on which circles you're talking about. I mean, hundreds of millions of people surely believe that the earth is flat. Maybe in Subsaharan Africa or in the Amazonian jungle, most people believe that. OTOH, most of those people would be totally uneducated, illiterate. Among even minimally educated people, such a belief would be quite rare.'

> 'Supposedly you're interested in this space, but are not interested enough to read a 2200 word essay by a guy who is the main developer of one of the primary templating tools.'

> 'I am arguing that the "strong principles" you believe in are the conseqence of fallacious, muddled thinking'

> 'I also have doubts that any feedback I would get at this point from you would be offered in good faith.'

> 'I just cannot bring myself to believe that anybody, when somebody casts doubt one whether they actually read something when, in fact, they did, would say "I tried to read it". I mean, that just too clearly implies that they didn't really read it.'

> 'It is highly frustrating when people pretend that they are seriously considering the ideas and then, when pressed, admit they never read the article...'

> 'If I were you, I would certainly hope nobody was reading this...'

> 'Well, if you believe that everybody is out to get you, and in fact they are, I suppose that's arguably not paranoia. At least it's no longer a paranoid delusion, which is what is usually meant, right?'

> 'Why not? Because they don't need you?'

> 'Well, I guess the people who created Windoze had a similar sort of mindset. They apparently aren't crazy about people installing or upgrading their apps without rebooting the OS...'

> 'I mean, frankly, the things you say just start amazing me to an increasing extent...'

and even your call to point out your falicies is a fallacy:

> 'Look, isn't it perfectly obvious that if if you could deconstruct any logical fallacy I was engaging in, you would have done so?'

> 'Could you outline some logical fallacy that I have used?
C'mon, surely if you could do so, you would have done it by
now, no?'


All text book examples of a very flawed way of discussing.

Add to that the emotionally charged language you are using: 'muddled thinking', 'misguided', 'dogma', 'defective', 'pussy behavior', 'brain death', 'WTF', 'mealy-mouthed nonsense' 'clownish pretending', 'phony', 'lazy', posturing', etc, and your general way of trying to attack as hard and low as you can, trying to ridicule 'opponents' with every chance you get, using cheap tricks like saying 'and I felt that X, who seems to be a reasonable guy,...'.

This discussion might actually have been good if it would just have stayed dry. You can call people stupid when they don't get your point (or don't agree), or you can wonder if you possibly would need a better way of explaining it and you could just explain your point in a manner that is just dry and matter-of-fact. I think the latter works best.

Jonathan Revusky

Posts: 19
Nickname: revusky
Registered: Jul, 2007

Re: What Do You Look For in a Template Engine? Posted: Jul 25, 2007 12:48 AM
Reply to this message Reply
> > I probably should pretend that I believe you, that I
> take your word for it, but I'm not going to do that. I
> just cannot bring myself to believe that anybody, when
> somebody casts doubt one whether they actually read
> something when, in fact, they did, would say "I tried to
> read it". I mean, that just too clearly implies that they
> didn't really read it.
>
> I tried to explain that this wasn't a slip, but my way of
> being sarcastic.

Okay, fine, whatever.

> You keep repeating your interpretation of
> the scentence that I wrote, and you think to back that up
> with 'proof' coming from my replies, which in fact *you*
> don't seem to understand.

Well, really, does it even matter? You can argue further like some kind of two-bit lawyer that you didn't mean what you seemed to say, and that, yes, you actually read the thing. And maybe you did, how do I know for sure? Does it really matter? After all, you were never under any obligation to read the thing. And even if you read the essay, you are not obliged to provide any feedback on it.

But I did take the time to write that essay on the Designer/Developer division of labor and it is the consequence of some serious thinking, some real grappling with the question. So, somehow, it is quite obnoxious to me when somebody feigns that they really read something and seriously thought about it and are giving you serious feedback, when obviously they haven't done so and the feedback is quite frivolous and really not offered in good faith.

I never claimed (it is a completely blatant straw-man on your part) that everybody had to agree with what I was saying there. I simply believed that it provided some basis for some kind serious discussion.

If what we are having now is not a serious discussion (and of course, it's not) I do not believe this can be laid at my door. How do you have a serious discussion with somebody who, for example, feels no onus to back up things that he says in the discussion?

Okay, this is the internet and such behavior is typical. Fine, but if you're going to behave in this kind of way, I don't see why you should whine so much when I point out that this is what you are doing.

>
> > > Your posts are full of logic falicies.
> >
> > Look, this is just getting to be really really realy
> annoying. This utterly pathetic childish posturing....
>
> Yes, very. I wish you'd stop it.
>
> A few examples:

You claimed that my posts were full of logical fallacies. I then said you should back up this claim. To simply provide a bunch of sentences I wrote quoted out of context is obviously not good enough.

You need to point out the logical fallacies that you claim I engage in. My posts are even full of them, you say, so it should be easy, right?

But look, cut the BS, it's not, because if it really was that easy to point out fallacies in my arguments, you would have done so by now. Everybody not born yesterday who is still reading this pathetic exchange knows that!

So this is a level of tiresome posturing that anybody can see through. I am now through with interacting with you -- at least for now. It's getting too tiresome This is really really just not a very enriching experience.


>
> > 'The conventional wisdom floating around...'
>
> > '... since that clearly does violate separation of
> concerns'
>
> > ' I am not Einstein, but I am reasonably on the ball by
> most standards. It is quite unwise to dismiss my
> observations on this topic out of hand. It really is....'
>
> > 'Anybody who was not born yesterday can see that you do
> not respond to me with legitimating debating points
> because you cannot...'
>
> > 'If I said (I don't know whether I said it, but I'll say
> it now) that you or Eelco do not really understand the
> separation of roles concept, it is because I honestly
> believe that you don't...'
>
> > 'I don't know if it was only me that the sarcasm was
> lost on.'
>
> > 'I cannot easily imagine myself saying "I tried to read
> X" with the intent of conveying the idea that I had
> actually read it...'
>
> > 'When you said you tried to read it, it was like a
> Freudian slip, because it really meant you hadn't read
> it...'
>
> > 'A smoker will tell me that there is no point in his
> stopping smoking because he could still get cancer even if
> he stops smoking...'
>
> > 'Just as it's impossible to follow Mark Twain's (joking)
> investment advice, because you don't know for sure whether
> the stock is going up or not, your advice on this cannot
> be followed in the general case, because it is impossible
> to anticipate all the different ways in which you might
> want to display data in the view...'
>
> > 'Similarly, the atheist's firm belief that there is no
> God is in fact a religious belief...'
>
> > 'as if some people come at you with some simplistic
> marxism and say that society is made up of two groups, the
> capitalists (the exploiters) and the workers (the
> exploited) and that's how you think about it...'
>
> > 'Well, it depends on which circles you're talking about.
> I mean, hundreds of millions of people surely believe that
> the earth is flat. Maybe in Subsaharan Africa or in the
> Amazonian jungle, most people believe that. OTOH, most of
> those people would be totally uneducated, illiterate.
> Among even minimally educated people, such a belief would
> be quite rare.'
>
> > 'Supposedly you're interested in this space, but are not
> interested enough to read a 2200 word essay by a guy who
> is the main developer of one of the primary templating
> tools.'
>
> > 'I am arguing that the "strong principles" you believe
> in are the conseqence of fallacious, muddled thinking'
>
> > 'I also have doubts that any feedback I would get at
> this point from you would be offered in good faith.'
>
> > 'I just cannot bring myself to believe that anybody,
> when somebody casts doubt one whether they actually read
> something when, in fact, they did, would say "I tried to
> read it". I mean, that just too clearly implies that they
> didn't really read it.'
>
> > 'It is highly frustrating when people pretend that they
> are seriously considering the ideas and then, when
> pressed, admit they never read the article...'
>
> > 'If I were you, I would certainly hope nobody was
> reading this...'
>
> > 'Well, if you believe that everybody is out to get you,
> and in fact they are, I suppose that's arguably not
> paranoia. At least it's no longer a paranoid delusion,
> which is what is usually meant, right?'
>
> > 'Why not? Because they don't need you?'
>
> > 'Well, I guess the people who created Windoze had a
> similar sort of mindset. They apparently aren't crazy
> about people installing or upgrading their apps without
> rebooting the OS...'
>
> > 'I mean, frankly, the things you say just start amazing
> me to an increasing extent...'
>
> and even your call to point out your falicies is a
> fallacy:
>
> > 'Look, isn't it perfectly obvious that if if you could
> deconstruct any logical fallacy I was engaging in, you
> would have done so?'
>
> > 'Could you outline some logical fallacy that I have
> used?
> C'mon, surely if you could do so, you would have done it
> by
> now, no?'
>
>
> All text book examples of a very flawed way of
> discussing.
>
> Add to that the emotionally charged language you are
> using: 'muddled thinking', 'misguided', 'dogma',
> 'defective', 'pussy behavior', 'brain death', 'WTF',
> 'mealy-mouthed nonsense' 'clownish pretending', 'phony',
> 'lazy', posturing', etc, and your general way of trying to
> attack as hard and low as you can, trying to ridicule
> 'opponents' with every chance you get, using cheap tricks
> like saying 'and I felt that X, who seems to be a
> reasonable guy,...'.
>
> This discussion might actually have been good if it would
> just have stayed dry. You can call people stupid when they
> don't get your point (or don't agree), or you can wonder
> if you possibly would need a better way of explaining it
> and you could just explain your point in a manner that is
> just dry and matter-of-fact. I think the latter works best.

Eelco Hillenius

Posts: 37
Nickname: ehillenius
Registered: Mar, 2006

Re: What Do You Look For in a Template Engine? Posted: Jul 25, 2007 12:54 AM
Reply to this message Reply
> What is your position on presentational logic? I see two
> possibilities from what you have said:
>
> (a) There is no such thing, presentation and logic are two
> separate dichotomous things.
>
> (b) Yes, there is such a thing, but since presentational
> logic is logic, it doesn't belong on the template layer
> and should be in the java code.
>
> I see (a) and (b) as two basic logical possibilities for
> you. In passing, it seems that the original poster, Frank
> Sommers, does believe that there is such a thing as
> presentational logic. I infer that from the second
> sentence of the article: "Presentational logic can be
> complex enough...."


My position *in general* is (b)

I believe that there are some problems/ missed opportunities with putting logic in templates and that an enforced separation more easily results in maintainable code, as it the logic will generally be more strongly typed, easier to navigate and due to Java's tooling support easier to debug, refactor, explore the API of components, etc.

For the particular framework I'm working with, the enforced separation of presentation and logic is really just part of the package. We believe this separation is helpful by itself, but it is also the enabler of some other features which are irrelevant in the light of this discussion.

In the end, it really depends on how you organize your projects. If the case about localizing your site you gave earlier may hold true for you, then a Freemarker-like approach probably makes more sense. Also, if you read e.g. how the programmers of Flickr organize their development (PHP templates and a Java back-end): they strictly enforce presentation from logic, but do it on discipline coding both aspects in PHP. They may have the best of both worlds, though they explictly state that it is a bad idea to directly tweak production templates.

> I do not recall ever providing my own personal interpretation of what the term means.

I thought you did when you said things like:
> 'As I understand it, this is precisely the entanglement that one should want to avoid and this, to me, is what we're talking about when we talk about separation of concerns.'
> '... since that clearly does violate separation of concerns'
> 'If I said (I don't know whether I said it, but I'll say it now) that you or Eelco do not really understand the separation of roles concept, it is because I honestly believe that you don't...'

I though you gave me enough directions to at least understand what you mean by it, and you also indicate that other interpretations are wrong.

> And, actually, come to think of it, I don't quite know why you would react negatively to my three-way paradigm. If partitioning the problem 2-ways is good, then partitioning it 3 ways is arguably even better, right?

Your three-way paradigm is fine. Whether this three way seperation makes sense depends on how you organize your projects/ what kind of frameworks you are using. In my personal experience, roles overlap/ shift and aren't always as clear. But if you develop in the way you propose, it makes sense to have these roles defined.

> The basic problem that I find in what you are saying is the idea that having logic (even presentational logic) in your template is a no-no, yet you see no problem w.r.t. SoC in having such presentational logic in your java code. It seems to me that there is clearly some disconnect there.

That is - as I stated before - because I believe that the distinction is rather between the static elements of presentation and of the dynamic parts. These two parts together form a whole, and both make up the UI layer. The difference between our views is that I would let Java code modify my markup and you put the modification code in the markup itself.

> I assume we're talking about parts that are at least somewhat dynamic because there is no issue wrt putting static parts of your presentation anywhere but in the template. That's a non-issue.

I am talking about the templates as a whole. Most templates in my experience will have a combination of static markup, which will typically have the purpose of organizing (tables, list definitions, etc) and layout (though I believe it is good practice to put most of the actual layout code in CSS where you can), and dynamic parts, such as printing of a title, looping through a list, conditionally displaying sections, etc.

> Well, as I said above, I guess the problem is when the dogma is mistaken.

Yes. And that is often subjective.

> > I used 'purely practical', as you mentioned that while you believe a strict separation is a good thing, it is not practical.
> I never said exactly that, I don't think.

Not exactly, but it was what I picked up from your blog and later replies. But please do correct me if I'm wrong.

> It's that I differ with you on what that model-view separation means.

Well, yes. Like I said earlier it depends on what you think is a useful separation of concerns. I don't believe that there is one correct answer to that, just choices.


> > Well, that just depends. I have to say I don't find the
> > case of where you develop a site, and then later pull a
> > copy of that site and localize that just using your
> > designers and 'website integrators' (and deploy it as a
> > seperate instance?) very convincing.
> Why not? Because they don't need you? :-)

No, that has nothing to do with it. What I don't find very convincing is that you would branch of your site because you localize it, and that rather than localizing it in a generic way you would opt for changing the templates directly. Not convincing doesn't mean impossible though. If that would be a real case for you, that's cool.

> Similarly, why should people have to rebuild or even restart some web app just because they tweaked a few templates?

Then we also have very different ideas on how to manage deployments. I'm not in favor of organization heavy processes, but I believe any version you deploy should at least have gone through a process where you run some unit tests, possibly some integration test, and possibly a more formal verification procedure. Also, working with such an automated process makes that your deployments are reproducable and if needed can be rolled back in a controlled manner. Of course, even on this you don't have to agree.

> I mean, frankly, the things you say just start amazing me to an increasing extent...
> Well, you can create new builds, I guess. But not everybody who just tweaked a template is in a position to rebuild or even restart the app. It is beyond me why you think that should be necessary anyway.

Heh, you can say that again :)

Eelco Hillenius

Posts: 37
Nickname: ehillenius
Registered: Mar, 2006

Re: What Do You Look For in a Template Engine? Posted: Jul 25, 2007 1:18 AM
Reply to this message Reply
> You claimed that my posts were full of logical fallacies. I then said you should back up this claim. To simply provide a bunch of sentences I wrote quoted out of context is obviously not good enough.

Somehow, I expected this answer. :)

The good thing about threads on a site like this is that anyone can read back to find those quotes, so I don't think it is that harmful that they are out of context. Actually I believe that they are more obvious if you read them in context.

> But look, cut the BS, it's not, because if it really was that easy to point out fallacies in my arguments, you would have done so by now. Everybody not born yesterday who is still reading this pathetic exchange knows that!

And there you go: 'if it was easy to point out -> you would have done so by now', and 'everybody not born yesterday ... knows that' are text book examples of fallacies.

As for naming them. I leave that as an exercise to the reader. The exact categorization of many of them is probably debatable.

Jonathan Revusky

Posts: 19
Nickname: revusky
Registered: Jul, 2007

Re: What Do You Look For in a Template Engine? Posted: Jul 25, 2007 2:06 AM
Reply to this message Reply
> > What is your position on presentational logic? I see
> two
> > possibilities from what you have said:
> >
> > (a) There is no such thing, presentation and logic are
> two
> > separate dichotomous things.
> >
> > (b) Yes, there is such a thing, but since
> presentational
> > logic is logic, it doesn't belong on the template layer
> > and should be in the java code.
> >
> > I see (a) and (b) as two basic logical possibilities
> for
> > you. In passing, it seems that the original poster,
> Frank
> > Sommers, does believe that there is such a thing as
> > presentational logic. I infer that from the second
> > sentence of the article: "Presentational logic can be
> > complex enough...."
>
>
> My position *in general* is (b)
>
> I believe that there are some problems/ missed
> opportunities with putting logic in templates and that an
> enforced separation more easily results in maintainable
> code,

I have a feeling that this begs the question.

Maintainable by whom?

Do I, a java programmer, want to maintain a bunch of HTML layout defined in java code, and then be bugged by people on the business side who want the page to look a tiny bit different, and then have to put in the change and have it require a whole rebuild/recompilation/retesting of the java codebase?

Another aspect of this is that FreeMarker macros are likely to be more maintainable (and by more different people) than equivalent java methods or classes. This is not solely because java is basically a hard-core programming language. It is also because Java is quite a poor language for string handling, generating text. FreeMarker, on the other hand, is a specialized tool for string handling and output.

So, actually, I think the best guess is that freemarker macros that generate parametrizable HTML snippets will be more maintainable than equivalent components written in java.

> as it the logic will generally be more strongly
> typed, easier to navigate and due to Java's tooling
> support easier to debug, refactor, explore the API of
> components, etc.

Here, you bring up certain valid points, I grant. There is a problem wrt to tool support for template languages -- I guess with the possible exception of JSP, and maybe XSLT, if you call that a template language, which it isn't exactly...

OTOH, the lack of tool support is remediable in principle.

As for refactoring, well, you can refactor a statically compiled language with greater confidence than a scripting/templating late binding sort of langage. OTOH, there are other counterbalancing factors there. That's a whole separate conversation really.

>
> For the particular framework I'm working with, the
> enforced separation of presentation and logic is really
> just part of the package. We believe this separation is
> helpful by itself, but it is also the enabler of some
> other features which are irrelevant in the light of this
> discussion.

???

>
> In the end, it really depends on how you organize your
> projects. If the case about localizing your site you gave
> earlier may hold true for you, then a Freemarker-like
> approach probably makes more sense. Also, if you read e.g.
> how the programmers of Flickr organize their development
> (PHP templates and a Java back-end): they strictly enforce
> presentation from logic, but do it on discipline coding
> both aspects in PHP. They may have the best of both
> worlds, though they explictly state that it is a bad idea
> to directly tweak production templates.
>
> > I do not recall ever providing my own personal
> interpretation of what the term means.
>
> I thought you did when you said things like:
> > 'As I understand it, this is precisely the entanglement
> that one should want to avoid and this, to me, is what
> we're talking about when we talk about separation of
> concerns.'

Okay, I say that separation of concerns mostly means, on a practical level, that different people can do their work without stepping on each other's toes. If that is my own special definition, then so be it, I will concede that this is my own special definition of the term. However, I kind of doubt it. I think that, at the end of the day, this is what SoC really does mean for most people.

I do not see how you are achieving SoC by putting all kinds of presentation-related things in java code, which is basically a black box for the kinds of people you would like to take ownership of that piece.

> > '... since that clearly does violate separation of
> concerns'
> > 'If I said (I don't know whether I said it, but I'll say
> it now) that you or Eelco do not really understand the
> separation of roles concept, it is because I honestly
> believe that you don't...'
>
> I though you gave me enough directions to at least
> understand what you mean by it, and you also indicate that
> other interpretations are wrong.
>
> > And, actually, come to think of it, I don't quite know
> why you would react negatively to my three-way paradigm.
> If partitioning the problem 2-ways is good, then
> partitioning it 3 ways is arguably even better, right?
>
> Your three-way paradigm is fine. Whether this three way
> seperation makes sense depends on how you organize your
> projects/ what kind of frameworks you are using. In my
> personal experience, roles overlap/ shift and aren't
> always as clear. But if you develop in the way you
> propose, it makes sense to have these roles defined.

My sense of things, I grant, more of an intuitive feeling, a hunch, than anything else, is that the roughly 3 roles exist in the problem space and the attempt to force things into a 2-way scheme is likely to cause more problems than it solves.

>
> > The basic problem that I find in what you are saying is
> the idea that having logic (even presentational logic) in
> your template is a no-no, yet you see no problem w.r.t.
> SoC in having such presentational logic in your java code.
> It seems to me that there is clearly some disconnect
> there.
>
> That is - as I stated before - because I believe that the
> distinction is rather between the static elements of
> presentation and of the dynamic parts. These two parts
> together form a whole, and both make up the UI layer. The
> difference between our views is that I would let Java code
> modify my markup and you put the modification code in the
> markup itself.

I guess that's right. I want to get all the messy HTML implementation details right the heck out of all my java code.

>
> > I assume we're talking about parts that are at least
> somewhat dynamic because there is no issue wrt putting
> static parts of your presentation anywhere but in the
> template. That's a non-issue.
>
> I am talking about the templates as a whole. Most
> templates in my experience will have a combination of
> static markup, which will typically have the purpose of
> organizing (tables, list definitions, etc) and layout
> (though I believe it is good practice to put most of the
> actual layout code in CSS where you can),

Is there some newer CSS spec out there that I am not aware of? (I don't ask this sarcastically, honestly.) You are not the only person in this conversation saying that they would do all kinds of things in CSS. My impression has been ( at least since the last time I looked at CSS) that you can't do all that much in CSS, at least in terms of what we're talking about in this conversation...

Frankly, I find the reference to doing all kinds of stuff with CSS rather confusing... maybe there is something I'm missing here....

> and dynamic
> parts, such as printing of a title, looping through a
> list, conditionally displaying sections, etc.

Well, yeah, okay. Templates do that...

>
> > Well, as I said above, I guess the problem is when the
> dogma is mistaken.
>
> Yes. And that is often subjective.

Well, I'm not that much of a relativist. I do not think that all ideas and approaches have equal merit. Some approaches are more promising than others and will typically work better. I do not claim to be in the possession of absolute truth about this, mind you, but I think there is something more or less like an absolute truth out there. I mean, which approach works better in practice, is, in principle, an empirically resolvable question.

>
> > > I used 'purely practical', as you mentioned that while
> you believe a strict separation is a good thing, it is not
> practical.
> > I never said exactly that, I don't think.
>
> Not exactly, but it was what I picked up from your blog
> and later replies. But please do correct me if I'm wrong.

Okay, let me correct you on that. You're wrong.

To you, it seems that separation of concerns is not having any programmatic logic in your templates. To me, it has more to do with not exposing inappropriate things to the template layer -- direct SQL query capabilities and so on. Logic that pertains to presentation, it seems to me that this is best dealt with on the template layer.

>
> > It's that I differ with you on what that model-view
> separation means.
>
> Well, yes. Like I said earlier it depends on what you
> think is a useful separation of concerns. I don't believe
> that there is one correct answer to that, just choices.

Well, as I said above, I am not so much of a relativist.

>
>
> > > Well, that just depends. I have to say I don't find
> the
> > > case of where you develop a site, and then later pull
> a
> > > copy of that site and localize that just using your
> > > designers and 'website integrators' (and deploy it as
> a
> > > seperate instance?) very convincing.
> > Why not? Because they don't need you? :-)
>
> No, that has nothing to do with it. What I don't find very
> convincing is that you would branch of your site because
> you localize it, and that rather than localizing it in a
> generic way you would opt for changing the templates
> directly.

I am not sure I understand the above distinction.

> Not convincing doesn't mean impossible though.
> If that would be a real case for you, that's cool.
>
> > Similarly, why should people have to rebuild or even
> restart some web app just because they tweaked a few
> templates?
>
> Then we also have very different ideas on how to manage
> deployments. I'm not in favor of organization heavy
> processes, but I believe any version you deploy should at
> least have gone through a process where you run some unit
> tests, possibly some integration test, and possibly a more
> formal verification procedure.

To me, it's a question of contracts. If there is a basic contract set up that certain data structures are exposed to certain templates, as long as you don't alter that contract, there should be no need to rebuild, or even restart the system when you modify the templates.

It is borderline incredible to me that you think that you should have to restart the world from zero just because a template was changed.


> Also, working with such an
> automated process makes that your deployments are
> reproducable and if needed can be rolled back in a
> controlled manner. Of course, even on this you don't have
> to agree.

Well, I'm not 100% sure of what you're even sayng. I'll simply re-iterate that changing the presentation layer should not require a whole rebuild of the system. In fact, I'd say that's FUBAR, completely unacceptable.

>
> > I mean, frankly, the things you say just start amazing
> me to an increasing extent...
> > Well, you can create new builds, I guess. But not
> everybody who just tweaked a template is in a position to
> rebuild or even restart the app. It is beyond me why you
> think that should be necessary anyway.
>
> Heh, you can say that again :)

Jonathan Revusky

Posts: 19
Nickname: revusky
Registered: Jul, 2007

Re: What Do You Look For in a Template Engine? Posted: Jul 25, 2007 2:19 AM
Reply to this message Reply
> > You claimed that my posts were full of logical
> fallacies. I then said you should back up this claim. To
> simply provide a bunch of sentences I wrote quoted out of
> context is obviously not good enough.
>
> Somehow, I expected this answer. :)
>
> The good thing about threads on a site like this is that
> anyone can read back to find those quotes, so I don't
> think it is that harmful that they are out of context.
> Actually I believe that they are more obvious if you read
> them in context.
>
> > But look, cut the BS, it's not, because if it really was
> that easy to point out fallacies in my arguments, you
> would have done so by now. Everybody not born yesterday
> who is still reading this pathetic exchange knows that!
>
> And there you go: 'if it was easy to point out -> you
> would have done so by now', and 'everybody not born
> yesterday ... knows that' are text book examples of
> fallacies.

What logical fallacy is that? If I said something like: "I'm a completely honest person" and you asked me "How do I know that?" and I responded "Obviously that is true. Would such a completely honest person tell a lie?" then I would be engaging in the beg-the-question fallacy, right? Because I'm using the proposition that is to be demonstrated to actually prove in a circular manner that same proposition.

Something like that. That is a logical fallacy. Find some statement like that I have made and point out how it is logically fallacious. My posts are full of logical fallacies, you say, so it should be easy.

But really, Eelco, why don't you just desist from any futher such nonsense?

>
> As for naming them. I leave that as an exercise to the
> reader. The exact categorization of many of them is
> probably debatable.

Being opinionated and expressing those opinions emphatically does not comprise a logical fallacy. Repeating oneself and being long-winded is not a logical fallacy either.

Geert Bevin

Posts: 28
Nickname: gbevin
Registered: Aug, 2006

Re: What Do You Look For in a Template Engine? Posted: Jul 25, 2007 3:14 AM
Reply to this message Reply
Jezus, Jonathan you're a nit-picker, I've indeed stopped reading the exchange here and feel quite sad that you turned a fruitful discussion about the different varieties of template engines into your own playground. You seem to make it your mission to try to prove how right you personally are with that blog post from a year ago and the approaches taken in Freemarker. You're right about one thing though, there's probably not a soul anymore that will read this thread until here.

Let me pick up some points that I still remember from the posts that I did read on this thread. Apparently a let of this discussion stems from your definition of SoC. The official definition is:
In computer science, separation of concerns (SoC) is the process of breaking a program into distinct features that overlap in functionality as little as possible. A concern is any piece of interest or focus in a program. Typically, concerns are synonymous with features or behaviors. (http://en.wikipedia.org/wiki/Separation_of_concerns)

So, if you already disagree with the world on this basic principle, then there isn't really much to discuss about. SoC is about designing and partitioning code, not separating and isolating task / languages / ... for people with different capabilities.

Going from there, having logic inside templates (which was the original discussion) violates the concern that the original purpose of a template in the layout world (which you admit you know nothing about, you never even started Illustrator, as you said yourself in your blog post) only contains building blocks to create your own layout, these templates don't operate on their layout elements themselves through their own execution model. Thus, similar to the layout applications that allow their users to pick parts of the template and aggregate them to build their own document, you can do that perfectly well with the main programming language of your project (be it Java, Ruby, Groovy, ... your pet-peeve about the deployment issue is again not relevant). The text manipulation capabilities of this language is a non-issue since you're not manipulating text, your merely re-structuring and aggregating semantic layout elements that have textual counterparts in the templates.

How you structure that code in your main programming language and how you isolate, is up to the programmer. Of course, if there's JDBC code in there or whatever, then he could be violating concerns again. This is a possibility anywhere you provide developers with a sufficiently capable programming language. There are very distinct advantages though to not having any logic inside template, for instance: they do become clearer and more concise as you only have the text content in there, nobody has to learn another language or toolset, the template clearly expresses what the individual layout elements are without anyone having to understand the logic that's intertwined, and you can properly create reusable pieces of code. What you advocate with Freemarker macros is only a small part of reusability story, most web applications nowadays are not really interested in reusing code snippets of how you created a table layout, but rather create richer components that incorporate state handling and a lot more. Simple macros don't cut it here unless you start violating a lot of concerns and tightly intertwine with your server-side state handling inside your templates.

Now, to play your own game, people like Jonathan Locke, Eelco Hillenius, Howard Lewis Ship, Terrence Parr, and me have all deeply thought about this too (surprise, you're not the only one) and came up with a solution going into a similar direction, though with different implementations. Most of us did a lot more than just work on template engines and we thus probably have a clearer image of the bigger picture. We have certainly all by far exceeded your credentials when it comes to community involvement and eagerness to innovate. Some of us even won awards for that. What kind of self-righteous person comes in here, touting his own greatness when you're just a very small piece of the puzzle. A little bit of humility would do you good. You might learn something.

Eelco Hillenius

Posts: 37
Nickname: ehillenius
Registered: Mar, 2006

Re: What Do You Look For in a Template Engine? Posted: Jul 25, 2007 3:16 AM
Reply to this message Reply
> Do I, a java programmer, want to maintain a bunch of HTML layout defined in java code,

No, you don't maintain a bunch of HTML layout. That's exactly what you do in the templates.

> and then be bugged by people on the business side who want the page to look a tiny bit different,

The main focus of development, after the mockups are done, would be with the Java developers yes. The way of developing that works best with the soc I advocate is to have designers do a lot of upfront work (not upfront for the project, just on a page by page basis) and Java developers fill in the gaps. In practice, the Java developers would make minor tweaks to these templates, and designers would shift their focus to working CSS.

> and then have to put in the change and have it require a whole rebuild/recompilation/retesting of the java codebase?

Yes. Definitively. I feel pretty strongly about setting up a development street even for smaller projects.

If you have a decent setup of your development street, the changes can be applied without any user interuption and without too much hassle in general. I love the description of Flickr's people where they talk about having a web page with two buttons 'deploy' and 'rollback'. Deploy checks out from scm, builds, packages, deploys in the cluster, etc. I'm not quite that far myself for the project I'm working on, as I need a few commands to do an update. But in general it takes less than a few minutes, and we're close to where we can do it without user interuption in the cluster.

> Another aspect of this is that FreeMarker macros are likely to be more maintainable (and by more different people) than equivalent java methods or classes. This is not solely because java is basically a hard-core programming language. It is also because Java is quite a poor language for string handling, generating text. FreeMarker, on the other hand, is a specialized tool for string handling and output.

A lot of that can be hidden by frameworks. Granted that Java can be verbose and even clumsy in that respect sometimes. But you get strong typing, code navigation etc back for that.

> As for refactoring, well, you can refactor a statically compiled language with greater confidence than a scripting/templating late binding sort of langage. OTOH, there are other counterbalancing factors there. That's a whole separate conversation really.

Yes. And my view makes more sense for statically typed languages then for dynamic ones.

> > For the particular framework I'm working with, the
> > enforced separation of presentation and logic is really
> > just part of the package. We believe this separation is
> > helpful by itself, but it is also the enabler of some
> > other features which are irrelevant in the light of this
> > discussion.

> ???

Like the ability to use convention over configuration and state management for example. I don't want to get into the details, but I hope you take it from me that this would have been impossible to implement in the way we wanted it if we didn't have a strict separation of presentation and logic.

> Okay, I say that separation of concerns mostly means, on a practical level, that different people can do their work without stepping on each other's toes.

> I do not see how you are achieving SoC by putting all kinds of presentation-related things in java code, which is basically a black box for the kinds of people you would like to take ownership of that piece.

As for people not stepping in each other's toes, having my proposed separation means that designers don't have to work around logic (they can't mess that up nor have to understand template DSLs) and programmers can better focus on what they are good at.

One thing that particularly annoyed me when I was using model 2 frameworks and Velocity, JSPs, XML/XSLT etc, is that there was not a lot of room to use proper object oriented programming. I know that using OO doesn't need to be an end by itself, but the ability to code reusable, statefull components with just Java is a fantastic improvement imho.

> I guess that's right. I want to get all the messy HTML implementation details right the heck out of all my java code.

I don't have to deal with HTML implementation details, unless you believe that instantiating a form and a textfield for instance are such details. The Java code looks more like what you'd write with a desktop application, but with the layout portions and HTML details factored out to the templates (or rather the other way around, as I would start with the templates).

> Is there some newer CSS spec out there that I am not aware of? (I don't ask this sarcastically, honestly.) You are not the only person in this conversation saying that they would do all kinds of things in CSS. My impression has been ( at least since the last time I looked at CSS) that you can't do all that much in CSS, at least in terms of what we're talking about in this conversation...

I'm simply refering to setting the colors, fonts, sizes, positioning, etc on elements. I'd try to avoid putting too much layout markup in your HTML (which typically results in a zillion nested tables) but try to use CSS for that instead. In my experience it's not always possible to be very pure with that, unless you are an incredible CSS guru maybe, but you can get quite far.

> > No, that has nothing to do with it. What I don't find very
> > convincing is that you would branch of your site because
> > you localize it, and that rather than localizing it in a
> > generic way you would opt for changing the templates
> > directly.

> I am not sure I understand the above distinction.

The distinction is that I'd go for a solution that would pick up the locale and pick a proper representation based on that, and not make a special case/ copy for it in the templates, probably by creating a set of specialized templates for that specific locale. That might work, but I think it is not as maintainable as using a single template. The latter is probably possible with your approach as well, but my guess is that you'd have to write a macro for it (or some Java code).

> Well, I'm not 100% sure of what you're even sayng. I'll simply re-iterate that changing the presentation layer should not require a whole rebuild of the system. In fact, I'd say that's FUBAR, completely unacceptable.

Fine. I am talking about the deployment for production systems if that wasn't clear. To me tweaking code on a live site, whether that is Java code or templates, without going through at least a minimal development street, is incredibly amateuristic, sorry for saying. That's where I'm not much of a relativist.

> My sense of things, I grant, more of an intuitive feeling, a hunch, than anything else, is that the roughly 3 roles exist in the problem space

Only if your problem space includes a template engine that allows for logic and a way of managing development where you want to allow for changes without rebuilding and/ or requiring Java developers. So for me, the third role is moot.

Eelco Hillenius

Posts: 37
Nickname: ehillenius
Registered: Mar, 2006

Re: What Do You Look For in a Template Engine? Posted: Jul 25, 2007 3:39 AM
Reply to this message Reply
> What logical fallacy is that? If I said something like: "I'm a completely honest person" and you asked me "How do I know that?" and I responded "Obviously that is true. Would such a completely honest person tell a lie?" then I would be engaging in the beg-the-question fallacy, right? Because I'm using the proposition that is to be demonstrated to actually prove in a circular manner that same proposition.

Oh yeah, technically you are right. Technically, most of my quotes can't be labeled fallicies. You are getting awefully close to a straw-man argument defending yourself here, but again, technically, it isn't.

Look again at the quotes I gave you. Call them whatever you want, but the last thing you can say of them is that they contributed to having a technical, fair and balanced discussion.

Take something like: 'if it was easy to point out -> you would have done so by now'. Ok, it is technically not a fallicy, but it has very little to do with proper argumentation.

Eelco Hillenius

Posts: 37
Nickname: ehillenius
Registered: Mar, 2006

Re: What Do You Look For in a Template Engine? Posted: Jul 25, 2007 11:18 AM
Reply to this message Reply
Ugh. I woke up this morning and couldn't feel anything but sorry for the time I wasted on stupid childish squabbling with someone who has had a reputation for that for years. There were a few occasions where this thread could have been interesting, though I never lost the feeling that the only reason why Jonathan participated was to state his presence and just win the argument. Call it pussy behavior or not Jonathan, rest assured this is the last interaction I've had with you. I'd call it not worth anyone's time.

Jonathan Revusky

Posts: 19
Nickname: revusky
Registered: Jul, 2007

Re: What Do You Look For in a Template Engine? Posted: Jul 25, 2007 12:07 PM
Reply to this message Reply
> > What logical fallacy is that? If I said something like:
> "I'm a completely honest person" and you asked me "How do
> I know that?" and I responded "Obviously that is true.
> Would such a completely honest person tell a lie?" then I
> would be engaging in the beg-the-question fallacy, right?
> Because I'm using the proposition that is to be
> demonstrated to actually prove in a circular manner that
> same proposition.
>
> Oh yeah, technically you are right. Technically, most of
> my quotes can't be labeled fallicies. You are getting
> awefully close to a straw-man argument defending yourself
> here, but again, technically, it isn't.

What do you mean "technically"? The quotes you provided simply do not comprise logical fallacies. And even if they did, you would have to explain what was fallacious about them.

But in general, Eelco, do you frequently find yourself redefining post facto what you meant when you said whatever?

"I tried to read the article." suggesting fairly clearly that you started and didn't finish it. This somehow means that you really did read the thing. "What I really meant was..."

"Okay, I said you engage in logical fallacies, but (seeing how I can't point out any) I meant something subtly diferent from that. Like, uhhhh, technically these aren't fallacies, but...." (WTF???)

"So, okay, what I really meant was..."

I mean, okay, fine, but let me run this idea by you.....

If you constantly find yourself redefining what you said after you said it, maybe.... just maybe... you should think about what you say a bit more before you say it. Then you won't be in the position of redefining what you said afterwards.


>
> Look again at the quotes I gave you. Call them whatever
> you want, but the last thing you can say of them is that
> they contributed to having a technical, fair and balanced
> discussion.

They're just quotes out of context. For example, the Mark Twain investing quote (a quote of a quote). I was making the point that when Mark Twain said "Buy a stock, sell it when it goes up and if it doesn't go up, don't buy it" you can't follow that advice because you have to know whether the stock is going to go up beforehand, and you can't in general." By analogy, your response to the issue of what happens when there is a new requirement, something even trivial like displaying something in other units like km vs. miles, you say, "well, we've got this special DistanceModel object that handles this".

Well, this assumes that you anticipated the need in the first place. The entire scenario I was positing assumed that you hadn't anticipated it in advance. In general, you cannot anticipate all needs in advance. So your response contained a logical fallacy basically analogous to the fallacy that Mark Twain (jokingly) offered about stock investing.

Anyway, I was providing a cogent argument in response to argumentation on your part that really was somewhat fallacious.

And, in general, the whole idea that to display the distance in km instead of miles is going to require a change to java code, and an entire rebuild and restart and retest according to all kinds of rigorous process and blah blah, I mean that's all just nutso.

>
> Take something like: 'if it was easy to point out -> you
> would have done so by now'. Ok, it is technically not a
> fallicy, but it has very little to do with proper
> argumentation.

<shrug>
I think it's a completely valid common-sensical argument. If my statements, when I made them contained logical fallacies that you could have pointed out, you would have pointed them out. But you didn't. Now, you're trying to find some nuanced way of redefining what you said: "When I said you engaged inlogical fallacies, I didn't mean exactly that.... because well... technically.. they're not fallacies, but what I really meant was....." And so I re-iterate what I said above about maybe thinking about what you say before you say it.

Flat View: This topic has 69 replies on 5 pages [ « | 1  2  3  4  5 | » ]
Topic: What Do You Look For in a Template Engine? Previous Topic   Next Topic Topic: Python 3000 Sprint @ Google


Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2014 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us