Re: CFSavecontent vs. multiple CFSets
Hi Michael, Is this one of the opinion questions you ask where you already know your own answer? :) I'd use the CFSaveContent method, but using CFXml instead of CFSaveContent - works the same, but validates the XML and created an XMLDocument object that can by turned into a string via toString(). -Joe On 10/11/05, Michael Dinowitz [EMAIL PROTECTED] wrote: In running through a shopping cart codebase (cartweaver), I decided to change a chunk of 40 or so CFSET operations into a single CFSAVECONTENT block. As this was for building an XML packet, it looked logical to me. No real savings in code size but to me it just looked cleaner and looked like 'less' operations. Question: What is your preference in such situations. Multiple CFSETs with each adding a new line of XML to the variable or a block of CFSAVECONTENT with the entire block wrapped in a CFOUTPUT? ~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:220656 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: CFSavecontent vs. multiple CFSets
For me, cfsavecontent looks more natural. The result is easier to see and more visual space is given to the action performed than the language performing the action. Steve Steve Bryant. Bryant Web Consulting LLC http://www.BryantWebConsulting.com/ http://steve.coldfusionjournal.com/ In running through a shopping cart codebase (cartweaver), I decided to change a chunk of 40 or so CFSET operations into a single CFSAVECONTENT block. As this was for building an XML packet, it looked logical to me. No real savings in code size but to me it just looked cleaner and looked like 'less' operations. Question: What is your preference in such situations. Multiple CFSETs with each adding a new line of XML to the variable or a block of CFSAVECONTENT with the entire block wrapped in a CFOUTPUT? ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:220658 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: CFSavecontent vs. multiple CFSets
On 10/11/05, Michael Dinowitz [EMAIL PROTECTED] wrote: In running through a shopping cart codebase (cartweaver), I decided to change a chunk of 40 or so CFSET operations into a single CFSAVECONTENT block. As this was for building an XML packet, it looked logical to me. No real savings in code size but to me it just looked cleaner and looked like 'less' operations. Question: What is your preference in such situations. Multiple CFSETs with each adding a new line of XML to the variable or a block of CFSAVECONTENT with the entire block wrapped in a CFOUTPUT? I think it depends. What versions of ColdFusion is the codebase expected to work with (I've not looked at cartweaver before)? cfsavecontent wasn't around pre-MX (natively, at least, as I know that it was initially a published custom tag). If the requirement involves pre-MX versions, then cfset is the most backward-compatible. If it's MX (any version), then I would actually likely use the cfxml tag, as that's what it's there for. Regards, Dave. ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:220665 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: CFSavecontent vs. multiple CFSets
CFSAVECONTENT is the fastest, since it doesn't have to make a bunch of intermediate strings to produce the final product, whereas CFSETs would... -Dov -Original Message- From: Steve Bryant [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 11, 2005 9:53 AM To: CF-Talk Subject: Re: CFSavecontent vs. multiple CFSets For me, cfsavecontent looks more natural. The result is easier to see and more visual space is given to the action performed than the language performing the action. Steve Steve Bryant. Bryant Web Consulting LLC http://www.BryantWebConsulting.com/ http://steve.coldfusionjournal.com/ In running through a shopping cart codebase (cartweaver), I decided to change a chunk of 40 or so CFSET operations into a single CFSAVECONTENT block. As this was for building an XML packet, it looked logical to me. No real savings in code size but to me it just looked cleaner and looked like 'less' operations. Question: What is your preference in such situations. Multiple CFSETs with each adding a new line of XML to the variable or a block of CFSAVECONTENT with the entire block wrapped in a CFOUTPUT? ~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:220666 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: CFSavecontent vs. multiple CFSets
I think it depends. What versions of ColdFusion is the codebase expected to work with (I've not looked at cartweaver before)? As far as I know the current Cartweaver codebase is supposed to be CF 5 compatible Massimo Foti Tools for ColdFusion and Dreamweaver developers: http://www.massimocorner.com ~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:220668 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: CFSavecontent vs. multiple CFSets
It is CF 5 compatible which is why I'm upgrading it to MX 7. I think it depends. What versions of ColdFusion is the codebase expected to work with (I've not looked at cartweaver before)? As far as I know the current Cartweaver codebase is supposed to be CF 5 compatible ~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:220691 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: CFSavecontent vs. multiple CFSets
It's just a question of preference. I chose CFSAVECONTENT over the CFXML due to familiarity but after reading your mention and looking it up, CFXML might be better, even with using the toString() function after it (another operation). Hi Michael, Is this one of the opinion questions you ask where you already know your own answer? :) I'd use the CFSaveContent method, but using CFXml instead of CFSaveContent - works the same, but validates the XML and created an XMLDocument object that can by turned into a string via toString(). -Joe On 10/11/05, Michael Dinowitz [EMAIL PROTECTED] wrote: In running through a shopping cart codebase (cartweaver), I decided to change a chunk of 40 or so CFSET operations into a single CFSAVECONTENT block. As this was for building an XML packet, it looked logical to me. No real savings in code size but to me it just looked cleaner and looked like 'less' operations. Question: What is your preference in such situations. Multiple CFSETs with each adding a new line of XML to the variable or a block of CFSAVECONTENT with the entire block wrapped in a CFOUTPUT? ~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:220696 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54