Are there actual performance differences ?
yes, well, in CF5 anyway. Unlike includes, which are processed as an integral part of the including template, modules/tags run in memory space separate to the space allocated to process the caller. As far as I know, this is the same with CFMX as templates included using cfinclude are not compiled into separate classes but become part of the class resulting from the compilation of the including template, whereas tags/modules, functions and components are compiled into separate classes.
You can test the performance difference by encapsulating a chunk of code into a separate template and then say create a loop calling the template 100 times. You'll notice the performance hit in your debug output calling the code as a module versus as an include.
I gather that tags are a more elegant way of passing parameters, and are a bit shorter in text space.
You've kinda hit on the fundamental difference - variable scope. Tags/modules allows parameters to be passed and values to be returned to caller, you cannot "pass" parameters to a cfinclude. If you use includes, you need to take into account that the include runs within the same scope as the including template. Tags/modules allow information to be hidden, i.e. variables which should be local to the encapsulated code are indeed local. The developer of the tag/module can work independently of the developer of the caller. The tag/module developer creates an interface (the attributes and return values) for the developer of the caller to work with. The developer of the caller does not have to worry about code in the tag/module changing information which should be local to the caller.
To those who strongly prefer tags, are there cases where you'd still use cfinclude instead ?
They have different functions as far as I'm concerned, but I'll use cfinclude where in theory I should really use a tag/module if I need to increase performance. There are numerous ways around scoping issues with code in included templates, mostly involving variable naming conventions, though none that are as simple as just using a tag/module ;)
Mark
--- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia http://www.mxdu.com/ + 24-25 February, 2004
