Seriously that's crazy. 

> -----Original Message-----
> From: John C. Bland II [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, February 15, 2006 12:19 PM
> To: CF-Talk
> Subject: Re: Try/Catch vs. direct error handling
> 
> Wow, that is the epitomy of overkill. :-)
> 
> In most of those cases I'd say it could be a performance hit 
> when you compare this code:
> 
> <cfset length = ArrayLen(blah)>
> <cfloop from="1" to="#length#" index="i"></cfloop>
> 
> to:
> 
> <cftry>
> <cfloop...></cfloop>
> <cfcatch type="any"> <!--- I guess he uses any ---> do stuff 
> </cfcatch>
> 
> Why force an error when you can easily set a var and loop 
> through the array contents that are there? It definitely 
> doesn't make sense, to me at least, and seems like there 
> would be a slight performance difference. This is simply my 
> opinion though.
> 
> On 2/15/06, Brad Wood <[EMAIL PROTECTED]> wrote:
> >
> > While we are talking about try/catch's, does anybody know 
> if there is 
> > a performance hit at all (worth mentioning) when you use try catch.
> >
> > The main reason I ask is because I work with someone who uses 
> > try/catch around EVERYTHING HE EVER CODES.  He will even use it to 
> > terminate loops and in place of if statements.
> > For example, instead of a loop from 1 to arraylen() he would just 
> > until an array out of bounds error was thrown, and then move on.
> > Or, instead of an isdefined(), he will try to access the 
> variable, and 
> > then put his <cfelse> in the catch.
> > I find this over-use to be excessive, but he claims it is perfectly 
> > rational and has no performance implications to process 
> hundreds and 
> > hundreds of try catch's per template.
> >
> > Any light you guys can shed?
> >
> > Thanks.
> >
> > ~Brad
> >
> >
> > 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232344
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

Reply via email to