On Wednesday, August 14, 2002, at 04:22 , Matthew Walker wrote:
> In this particular case I didn't think the thread had changed. I thought
> I was talking about whether the concept of using Compare() negated the
> existence of the issue regarding 33d. I was just woken up and was eating
> breakfast at the time, so I may have been mistaken, as often I am at
> that terrible hour.

Ah, the "not enough coffee yet" time... I know it well. Yes, looking back 
at the posts, there were still elements of the original question but I 
think I was frustrated by the 100+ ("lots" anyway) posts with the same 
subject, many of which weren't really dealing with the original issue... I 
just happened to pick your post to reply to because it raised a different 
point that I wanted to address... My bad, too, I suppose.

> While best practices do change from company to company / version to
> version etc, I think it's reasonable to say there is a more or less
> established but unwritten set of best practice ideas circulating.

Well, I'm not quite so convinced since there seem to be so many 
disagreements on anything held up as 'best practice'...

> reasoning for that is that I hear the same ideas (e.g. use <cfif x>
> rather than <cfif x neq 0>) over and over.

And as an example, that's one I would disagree (vehemently) with, unless 
'x' is a boolean (true/false).

If 'x' is genuinely boolean, then '<cfif x>' is the more intentional way 
to write it (although 'x' is a *terrible* name for a boolean variable! :)

If 'x' is an integer, then the comparison should be against zero - again, 
emphasizing the *intention* behind the code.

With a decent compiler, there should be no speed difference - and even if 
there is, the readability of the code would almost always outweigh any 
marginal performance gain.

When would I sanction using the faster code instead of the more readable 
code? Only when someone had proved to me that in their particular 
application, changing that fragment made a measurable - and significant - 
improvement in execution speed.

I spent years doing code audits and writing coding guidelines around the 
world so I'm fairly passionate about this sort of thing! :)

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to