ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <dona...@apache.org>
Subject RE: Configure->Template->Build
Date Tue, 05 Jun 2001 14:54:55 GMT
At 01:44 PM 6/5/01 +0100, Jose Alberto Fernandez wrote:
>Peter, parameterized software modules have existed in programming languages
>since I guess Algol-66. And that is the analogy I used for <projectref>.
>Templating, I associate more with Macro expansion. The basic difference
>being that a template provides (in general) no syntax nor semantic checking.
>Until you expand the template, in general, you cannot know whether the
>result is a well formed thing or not.

don't know where you would get that idea. 'Templates' in my experience is a
way to create a instance based on particular parameters. What you describe
makes me think you have used C++'s ugly templates ;)

>As a parameterized module, <projectref> does not suffer from that. Since the
>referenced project needs to be a valid <project> it can be verified
>syntactically, semantically and in most cases it can be executed on its own.
>You cannot do that with templates except for very few, and I would say
>un-interesting, cases.

false. The reason that I want static templating is for the extra safety it
offers. If you really want to argue that dynamic templating is good then I
think it would be best to go dig up the email sent last round of Ant2
'proposals' regarding this topic. So far no one has offered a clearer
explanation of issues. Neither has anyone refuted his claim that dynamic
templating is evil. Feel free to try. 

>Look at this template, can the system verify that every expansion will
>generate a syntactically correct ANT file? I do not think it can. Even with
>input that may seem valid you can produce bad syntax (due to the
>interactions of different xsl:templates, for example). You do not get that
>kind of issues with <projectref> you can verify the validity of the referred
>project on its own, and given valid parameters to the <projectref>, which
>you can validate, you know the total is valid.

err? don't be silly. projectref does not guarentee integrity anymore or
less that other templating forms. Worse it defers many behaviour choices to
runtime that could be done before hand.

>This is a much more modular approach.

you have got to be kidding me. Maybe for toy projects but they are not who
this is provided for. Spagettis is what this produces - as thread of
execution travels between each project constantly changing frames,
terrorizing anyone who has to read it and try to understand the values of
things without executing it. Thankfully this approach in programming died a
death by early 90s, I would hate to see it come back in a build system.

I invite you to actually try some practical examples. Try using both
approaches and honestly judge which is simpler. You could be surprised ;)


Cheers,

Pete

*-----------------------------------------------------*
| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof."                   |
|              - John Kenneth Galbraith               |
*-----------------------------------------------------*


Mime
View raw message