House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

Using ## vs not using ##

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Ok, i have another one. (In CF7)
Michael Grant
09/01/10 12:27 P
> Ok, i have another one. (In CF7)
Dave Watts
09/01/10 12:31 P
It makes me want to barf.
Michael Grant
09/01/10 12:35 P
> <CFSET ERRORS[VARNAME]['STRING']
Michael Grant
09/02/10 08:59 A
According to Adobe, yes.
Eric Cobb
09/01/10 12:46 P
Thanks Eric.
Michael Grant
09/01/10 12:50 P
just a quick test, please ignore
Peter Boughton
09/02/10 11:07 A
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Michael Grant
09/01/2010 12:27 PM

Ok, i have another one. (In CF7) Here's an example of code I'm running into: <cfset errors["#varName#"]["string"] = errors["#varName#"]["string"] & "bit to add here."/> I would normally write this as: <cfset errors[varName]["string"] = errors[varName]["string"] & "bit to add here."/> Other than the fact it's nicer to look at and just makes sense to do it my way, is there actually any speed increase doing it my way?

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dave Watts
09/01/2010 12:31 PM

----- Excess quoted text cut - see Original Post for more ----- There will not be a significant speed increase, so don't worry about changing existing code unless you have time on your hands and it really offends you. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Michael Grant
09/01/2010 12:35 PM

It makes me want to barf. However I don't really have the time for it. ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Rick Root
09/02/2010 08:32 AM

>> <cfset errors["#varName#"]["string"] = errors["#varName#"]["string"] & "bit >> to add here."/> > > There will not be a significant speed increase, so don't worry about > changing existing code unless you have time on your hands and it > really offends you. It offends me, so I say he should do it. =) From a performance perspective, it might matter if there were a thousand of them on a page that was accessed a thousand times per second.... I would think that using ["#varname#"] would actually create a new string object in the java code where as [varname] would not.. but who knows. Still, the code IS offensive =) It would only be worse if it were like this... <CFSET ERRORS[VARNAME]['STRING'] = EVALUATE("ERRORS[""#VARNAME#""][""STRING""]") & "bit to add here."> Heh.  (Yes, that does work) Rick

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Michael Grant
09/02/2010 08:59 AM

> <CFSET ERRORS[VARNAME]['STRING'] > = EVALUATE("ERRORS[""#VARNAME#""][""STRING""]") & "bit to add here."> > /me vomits

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Rick Root
09/02/2010 09:05 AM

evaluate() is almost always offensive :) On Thu, Sep 2, 2010 at 8:58 AM, Michael Grant <mgrant@modus.bz> wrote: ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dave Watts
09/02/2010 09:11 AM

> It offends me, so I say he should do it. =) Are you paying him? If so, he should definitely do it! I used to have the same opinion as you - I couldn't stand working with other people's code if it didn't meet my own standards. Now that I'm older, I think life's too short for that. Working code has an intrinsic value regardless of the ugliness of the source. If you have to work in that specific source repeatedly, it might be worth changing, but otherwise just hold your nose and move on. > From a performance perspective, it might matter if there were a > thousand of them on a page that was accessed a thousand times per > second.... In my prior measurements, conducted many years ago, it didn't make a significant measurable difference. > I would think that using ["#varname#"] would actually create a new > string object in the java code where as [varname] would not.. but who > knows. I would caution against making any assumptions about the underlying Java code from the way CF appears to work from the "outside". > Still, the code IS offensive =) I agree! > It would only be worse if it were like this... > > <CFSET ERRORS[VARNAME]['STRING'] = > EVALUATE("ERRORS[""#VARNAME#""][""STRING""]") & "bit to add here."> > > Heh.  (Yes, that does work) That's pretty bad. I've seen worse, though. Don't get me started. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Eric Cobb
09/01/2010 12:46 PM

According to Adobe, yes.   http://www.adobe.com/devnet/coldfusion/articles/coldfusion_performance_04.html Although, I'm sure it's probably negligible.  All they really say is that the extra pound signs "will negatively affect performance". Thanks, Eric Cobb ECAR Technologies, LLC http://www.ecartech.com http://www.cfgears.com Michael Grant wrote: ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Peter Boughton
09/02/2010 11:07 AM

just a quick test, please ignore (sorry for the noise)

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Michael Grant
09/02/2010 11:19 AM

Note to all participants: This thread is not to be used for testing purposes. Thank you, Management On Thu, Sep 2, 2010 at 11:00 AM, Peter Boughton <boughtonp@gmail.com> wrote: > > just a quick test, please ignore > > (sorry for the noise)


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

February 08, 2012

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29