I'd be remiss in my responsibilities if I didn't point out that Macromedia recently launched a "tips" application for tips submitted by the community.
http://www.macromedia.com/v1/tipsubmission/main.cfm Admitedly, those submissions aren't subject to "panel" approval, so it's not exactly the same thing. Nevertheless, folks will be looking at the stuff there, so I would encourage anyone to submit their coding tips there too, as well as offer feedback on any tips you read there. Vernon Viehe ColdFusion Community Manager Macromedia, Inc. -----Original Message----- From: Paul Giesenhagen To: CF-Talk Sent: 8/15/2002 6:28 AM Subject: Re: Best Practices Charlie, I think this is a great idea, I have no formal background in any language, but picking things up here and there has made my life easier. I think your idea of a place for tips would be great... and since this list has provide such a great service, maybe it should be here on HoF! It would also be nice to have a 'board' if you will that approves a 'Best' practice before it is placed as a valid best practice. Maybe even to go as far as placing 'tips' online with advantages and disadvantages ... Just to explain why it is good and why it is not so a best practice can then be determined depending on usage. Example would be: <cfif if only 1-2 variables, but use <cfswitch if comparing many.... Both are good practices, both yield the same results, but one (cfif) is much quicker to code and the savings in execution may be minimal and thus <cfif would be the 'best' practice... with explination that would be useful to a user. I guess I what I am saying is have best practices, tips or whatever you want to call it, but give the explination as to WHAT they do and their advantage, disadvantage. Then have a group, approve disapprove and you will have one heck of a document. Just my .02 I think it would be great ... Mike D, do you want to have something like this? Paul Giesenhagen QuillDesign ----- Original Message ----- From: "Charlie Griefer" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Thursday, August 15, 2002 1:58 AM Subject: Re: Best Practices > OK...let's just cut the name of the thread to 'Best Practices' :) > > While there will always be some 'subjectivity' as to 'how' to code, there > certainly are 'better' ways, 'worse' ways, and yes...'best' ways. It's the > 'best' ways that I'm interested in. > > Somebody brought up previously that there shouldn't be a central 'best > practices' document, as it may be intimidating to beginners (if i understood > correctly). I can see that...but I can also see that where a beginner would > learn the 'most simple' or 'most straightforward' way (ie learning <cfif > myVar is ""> before learning <cfif len(trim(myVar))>). > > My contention/issue/point is that there are almost always 'better' ways to > code (by better, I'm referring to more efficient). If I can be a better > coder (which I know I can), I would want to know how. > > Yes, one can certainly pick up tidbits of information here and there > (whether it be on the forums, newsgroup, this list, or any of the cf-related > sites out there)...but I'm sure very few of us have the luxury of that kind > of time to look (heck, we wouldn't even know what to look for). > > Might be nice to start a "cf coding tips" site...I'd be more than happy to > throw a form online to collect tips from anybody who wants to enter a few > (as well as a page to output them). Over time it might even become the > basis for a best practices doc (maybe setting up a 'rate this tip' to see if > it really is something that people have found works for them). I know that > I'd benefit greatly from such a site. I'd like to think that many others > would as well. > > Anybody have any thoughts on that? Thoughts on hosting? I can do it, and > would be more than happy to...but perhaps a better known cf-related site > would be a better 'home' for it (i'd still be willing to code it). > > Feedback/comments/suggestions appreciated :) > > Charlie > > ----- Original Message ----- > From: "Sean A Corfield" <[EMAIL PROTECTED]> > To: "CF-Talk" <[EMAIL PROTECTED]> > Sent: Wednesday, August 14, 2002 11:28 PM > Subject: Re: Best Practices (was: Re: 33 and 33d the same? > > > > 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 > > > > > ______________________________________________________________________ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm 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