Re: Best Practices

2002-08-14 Thread Charlie Griefer

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  before learning ).

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 
> > rather than ) 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 '' 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
>
> 
__
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.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



Re: Best Practices (was: Re: 33 and 33d the same?

2002-08-14 Thread Sean A Corfield

On Wednesday, August 14, 2002, at 11:42 , Matthew Walker wrote:
> Interesting. I would do this for readability, not speed. To take a
> common example I would see
>
> 
>
> as more readable and immediately understandable than
>
> 

Ugh! :) I'd always write the latter (or <... eq 1> since I'm usually 
trying to get back just a single record in many of my queries!).

> I guess also I think of any non-zero value as
> boolean as I come from a CF background.

Probably. As I think I've said before on this list (I've said it several 
times on other lists!): the languages you know inform the way you program.
.

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

__
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.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



Re: CGI & Sun Vs. CF & NT HELP!!!!

2002-08-14 Thread Sean A Corfield

On Wednesday, August 14, 2002, at 06:51 , Will Ryan wrote:
>   Well I don't want to name the vendor, they have a good product, it works
> and is being used.  I'm just concerned that using CGI rather then CF or 
> even
> ASP for that matter is a step in the wrong direction.  I'm even more
> concerned about using a text file vs. a modern database.  I just need to
> explain to management the pros/cons of CGI Vs CF.

I'm a little puzzled as to why you're classing Informix as 'a text file'? 
Or is this new application using just the ISAM format? See:
http://www-3.ibm.com/software/data/informix/
for more details about the Informix product family.

As for CGI vs CF... it all depends on what the CGI is written in, I 
suppose. Perl is commonly used for CGIs and it's free. Moreover, such CGIs 
can be compiled into the web server (Apache) so that they are very fast. 
And modern Perl has OO features.

A lot of solid, commercial products run successfully in Perl. Probably 
more than in CF, in fact.

Now, you've since said this new application is written in BASIC... which I 
must admit is completely new to me (CGI applications in BASIC, not BASIC 
itself!). Especially on Solaris!

I really think you need to tell us which product you're talking about...

Sean A Corfield -- http://www.corfield.org/blog/

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

__
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
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



RE: Best Practices (was: Re: 33 and 33d the same?

2002-08-14 Thread Matthew Walker

> 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 '' 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.

Interesting. I would do this for readability, not speed. To take a
common example I would see 



as more readable and immediately understandable than 



I guess I am treating this integer as if it's a boolean meaning "Query
record set has rows". I guess also I think of any non-zero value as
boolean as I come from a CF background. Those from a more strict
background might not. I guess fundamentally we find what we normally do
to be more readable than what other people normally do. ;-)
__
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
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



Re: CF Express

2002-08-14 Thread Sean A Corfield

On Wednesday, August 14, 2002, at 09:16 , John Wilker wrote:
> Except for the project I have a need of, even pro is more than I need,
> IIRC express was priced right and did the job, I don't need a great many
> features for this project but price is kinda an issue.

So the *free* Developer Edition sounds like what you need then?

Or do you need the server to allow more than one external IP address to 
connect to it?

Note: Developer Edition is what you get in Studio MX and also what the 
Trial Download version turns into after 30 days (it is Enterprise for the 
first 30 days).

Sean A Corfield -- http://www.corfield.org/blog/

"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



Re: Best Practices (was: Re: 33 and 33d the same?

2002-08-14 Thread Sean A Corfield

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 
> rather than ) 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 '' 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



RE: CF Express

2002-08-14 Thread John Wilker

Except for the project I have a need of, even pro is more than I need,
IIRC express was priced right and did the job, I don't need a great many
features for this project but price is kinda an issue.

I'll dig around some.

J. 
 
John Wilker  "Codito, ergo sum"
Web Applications Consultant, and Writer
Macromedia Certified ColdFusion Developer
President/Founder, Inland Empire CFUG.
www.red-omega.com
 
I asked "Do you know DOS?"
 
The reply was: "No, but I met Tom and Drew a few minutes ago."


-Original Message-
From: mark brinkworth [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, August 14, 2002 8:54 PM
To: CF-Talk
Subject: Re: CF Express


As far as I know CF4.5 was the last that had an express version. With
the 
release of the developer version, there seems little point is such a
thing.





>Is there a CF Express in MX?
>
>I didn't see any mention of it on the MACR site.
>
>J.
>







__
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
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



RE: CF Express

2002-08-14 Thread John Wilker

I thought that might be the case. Just wanted to make sure.

Thanks!

J. 
 
John Wilker  "Codito, ergo sum"
Web Applications Consultant, and Writer
Macromedia Certified ColdFusion Developer
President/Founder, Inland Empire CFUG.
www.red-omega.com
 
I asked "Do you know DOS?"
 
The reply was: "No, but I met Tom and Drew a few minutes ago."


-Original Message-
From: Howie Hamlin [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, August 14, 2002 8:46 PM
To: CF-Talk
Subject: Re: CF Express


I don't think that there is a version of Express beyond version 4.5 and
I don't think that there will be one...

Regards,

--
Howie Hamlin - inFusion Project Manager
On-Line Data Solutions, Inc. - www.CoolFusion.com  - 631-737-4668 x101
inFusion Mail Server (iMS) - The Award-winning, Intelligent Mail Server
>>> Find out how iMS Stacks up to the competition: 
>>> http://www.coolfusion.com/imssecomparison.cfm

- Original Message - 
From: "John Wilker" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Wednesday, August 14, 2002 11:38 PM
Subject: CF Express


> Is there a CF Express in MX?
>  
> I didn't see any mention of it on the MACR site.
>  
> J.
>  
> John Wilker  "Codito, ergo sum"
> Web Applications Consultant, and Writer
> Macromedia Certified ColdFusion Developer
> President/Founder, Inland Empire CFUG.
> www.red-omega.com 
>  
> I asked "Do you know DOS?"
>  
> The reply was: "No, but I met Tom and Drew a few minutes ago."
>  
> 
> 

__
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



Re: CF Express

2002-08-14 Thread mark brinkworth

As far as I know CF4.5 was the last that had an express version. With the 
release of the developer version, there seems little point is such a thing.





>Is there a CF Express in MX?
>
>I didn't see any mention of it on the MACR site.
>
>J.
>






__
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.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



Re: CF Express

2002-08-14 Thread Howie Hamlin

I don't think that there is a version of Express beyond version 4.5 and I don't think 
that there will be one...

Regards,

--
Howie Hamlin - inFusion Project Manager
On-Line Data Solutions, Inc. - www.CoolFusion.com  - 631-737-4668 x101
inFusion Mail Server (iMS) - The Award-winning, Intelligent Mail Server
>>> Find out how iMS Stacks up to the competition: 
>http://www.coolfusion.com/imssecomparison.cfm

- Original Message - 
From: "John Wilker" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Wednesday, August 14, 2002 11:38 PM
Subject: CF Express


> Is there a CF Express in MX?
>  
> I didn't see any mention of it on the MACR site.
>  
> J.
>  
> John Wilker  "Codito, ergo sum"
> Web Applications Consultant, and Writer
> Macromedia Certified ColdFusion Developer
> President/Founder, Inland Empire CFUG.
> www.red-omega.com  
>  
> I asked "Do you know DOS?"
>  
> The reply was: "No, but I met Tom and Drew a few minutes ago."
>  
> 
> 
__
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
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



CF Express

2002-08-14 Thread John Wilker

Is there a CF Express in MX?
 
I didn't see any mention of it on the MACR site.
 
J.
 
John Wilker  "Codito, ergo sum"
Web Applications Consultant, and Writer
Macromedia Certified ColdFusion Developer
President/Founder, Inland Empire CFUG.
www.red-omega.com  
 
I asked "Do you know DOS?"
 
The reply was: "No, but I met Tom and Drew a few minutes ago."
 

__
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
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



RE: Calling CFM file from an HTML page

2002-08-14 Thread Dave Watts

First, I'd like to apologize in advance for the length of this email.

> The fuselet does not actually generate JavaScript code, 
> it is entirely in ColdFusion and all output content 
> remains in ColdFusion (HTML) format, the trick to the 
> application is in the  tag. It calls the applications
> and loads the output content directly on to the page, 
> but it (the CFM file) does not create actual JavaScript 
> content.
> 
> As for the view source, no... if you view the source all you 
> see is the SCRIPT tag you type in to reference the application, 
> no additional content. If you try to access the URL directly 
> (the one referenced in the tag) you get an error message, so 
> really the viewer does not see any HTML content.

It looks to me like you can fetch the content pretty easily. It just takes
two subsequent requests. Below my signature, I've appended the content from
the "flasher" fuselet. As you can see, it's 100% JavaScript (although the
browser will render it as HTML via document.write) and it's 100% readable.

Keep in mind I did this the hard way, by reconstructing the URLs. It
would've been much easier to just fire up a recording proxy and read all the
incoming data directly.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

// request 1, in which I fetched this URL:
//
http://www.hksi.net/subliminalflasher/flasher2.htm?caller=http:%3A//www.fuse
lets.com/Products/

var mySettings = "caller=http:%3A//www.fuselets.com/Products/&";
var myQueryString = "";
var myCaller = self.document.URL;
if (myCaller.indexOf("?")>=0){
var myURL = myCaller.split("?");
myQueryString = myURL[1];
myCaller = myURL[0];
}
if (myQueryString!="") myQueryString = "&" + myQueryString;
document.write('