Re: Comparisons - Your thoughts

2009-07-15 Thread Eric Cobb

While I'll agree that the readability/maintainability factor is 
important from a developer's viewpoint, that particular article was 
specifically focused on performance and was merely pointing out which 
functions were technically faster.

If one function is built to be faster than another function, then that's 
how it's going to perform, regardless of whether or not it's easy for 
the developer to read.

That being said, I'll have to agree with Brad and Charlie on sometimes 
coding what's easiest to read and maintain.  You do reach a point where 
maintainability can play a larger role than squeezing out every tiny 
little millisecond of speed (on most apps).


Thanks,

Eric Cobb
Certified Macromedia ColdFusion MX 7 Developer
http://www.cfgears.com


Charlie Griefer wrote:
> I'd be leery of something that says, "always".
> 
> Sometimes, it's OK to consider the readability/maintainability factor.
> 
> On Wed, Jul 15, 2009 at 2:08 PM, Eric Cobb  wrote:
> 
>> According to this "Performance tuning for ColdFusion applications" post,
>> you should always use compare() or compareNoCase() instead of the IS NOT
>> operator, and you should use listFindNoCase() or listFind() instead of
>> the IS and OR operators.
>>
>>
>> http://www.adobe.com/devnet/coldfusion/articles/coldfusion_performance_04.html
>>
>>
>> Thanks,
>>
>> Eric Cobb
>> Certified Macromedia ColdFusion MX 7 Developer
>> http://www.cfgears.com
>>
>>
>> Jason Fisher wrote:
>>> I have long been in the habit of using EQ and NEQ (and now moving to ==
>> and !=) for numbers in all cases, since there is no such thing as 'sort of
>> equivalent', like there is with strings ('foo IS FOO' etc).  For strings I
>> use IS, unless case is important, and then I use CompareNoCase().
>>>
>>
> 
> 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324557
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Comparisons - Your thoughts

2009-07-15 Thread Charlie Griefer

I'd be leery of something that says, "always".

Sometimes, it's OK to consider the readability/maintainability factor.

On Wed, Jul 15, 2009 at 2:08 PM, Eric Cobb  wrote:

>
> According to this "Performance tuning for ColdFusion applications" post,
> you should always use compare() or compareNoCase() instead of the IS NOT
> operator, and you should use listFindNoCase() or listFind() instead of
> the IS and OR operators.
>
>
> http://www.adobe.com/devnet/coldfusion/articles/coldfusion_performance_04.html
>
>
> Thanks,
>
> Eric Cobb
> Certified Macromedia ColdFusion MX 7 Developer
> http://www.cfgears.com
>
>
> Jason Fisher wrote:
> > I have long been in the habit of using EQ and NEQ (and now moving to ==
> and !=) for numbers in all cases, since there is no such thing as 'sort of
> equivalent', like there is with strings ('foo IS FOO' etc).  For strings I
> use IS, unless case is important, and then I use CompareNoCase().
> >
> >
>
> 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324556
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Comparisons - Your thoughts

2009-07-15 Thread Eric Cobb

According to this "Performance tuning for ColdFusion applications" post, 
you should always use compare() or compareNoCase() instead of the IS NOT 
operator, and you should use listFindNoCase() or listFind() instead of 
the IS and OR operators.

http://www.adobe.com/devnet/coldfusion/articles/coldfusion_performance_04.html


Thanks,

Eric Cobb
Certified Macromedia ColdFusion MX 7 Developer
http://www.cfgears.com


Jason Fisher wrote:
> I have long been in the habit of using EQ and NEQ (and now moving to == and 
> !=) for numbers in all cases, since there is no such thing as 'sort of 
> equivalent', like there is with strings ('foo IS FOO' etc).  For strings I 
> use IS, unless case is important, and then I use CompareNoCase(). 
> 
> 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324555
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Comparisons - Your thoughts

2009-07-15 Thread Jason Fisher

I have long been in the habit of using EQ and NEQ (and now moving to == and !=) 
for numbers in all cases, since there is no such thing as 'sort of equivalent', 
like there is with strings ('foo IS FOO' etc).  For strings I use IS, unless 
case is important, and then I use CompareNoCase(). 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324551
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: Comparisons - Your thoughts

2009-07-15 Thread brad

I prefer 

Seriously though, do what looks best and is easiest to read and
maintain.  I have seen performance benefits of one way over another, but
they are few and far between.  
Most of my business logic is in cfscript these days and I'm usually
kickin it with the ECMA operators like == != etc.

~Brad

 Original Message 
Subject: Comparisons - Your thoughts
From: Chuck Weidler 
Date: Wed, July 15, 2009 1:52 pm
To: cf-talk 


I was wondering what the community was doing with comparisons, like in a
cfif. I have done it many different ways. List below are just few
examples, and yes I know that the Compare() and CompareNoCase() should
be used for string comparison and not numbers, but I have seen it done
that way in some code that I maintain at work. I'm not saying one way is
better than another I just want you to give your opinions.



~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324550
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4