|Think about Loose Coupling|
Re: Re: Re: Templating system for generating C code?by clscott (Friar)
|on Mar 23, 2004 at 17:42 UTC||Need Help??|
The biggest advantage of using a template module over the HEREDOCS is the ease with which you can substitute the templates to generate differnt output for whatever reason you might need to:
The biggest advantage of encapsulating the "display" logic in the templates is that it simplifies the responsibilities of your application to:
It also becomes much easier to produce all of those other formats that we might want because the templates now recieve all of the data in context and allow it to make output decicions based on the data rather than be an external holder to interpolated strings.
This would allow you to generate your C project many different ways without having to edit and re-edit versions of your application.
This allows you to maintain a parallel set of templates rather than "parallel" copies of the same application if you needed to test optimisation changes to your C code. Especially if changes to the output required changes to the display logic
In the end what technique you decide to use depends on what you really want to do with the information you have.
If you don't need all the stuff, don't bother with it, but I like it when I can write a few templates and the beginnings of a documentation outline cheap.
It makes my manager happy to have documentation, and when my managed is happy I'm usually in a better mood :)--