Re[2]: Best practices
I assume the GNOME scope is only used for really short variables, yes? (sorry, I just couldn't resist) :) -- Cheers! Michael David -- Original Message -- From: "Stephens, Larry V" To: "cf-talk" Sent: 6/21/2012 9:26:48 AM Subject: RE: Best practices >And, IMO, there's a point too often overlooked: commenting and style (as in >indenting code and naming stuff). > >I've sometimes been weak about comments in my code - but I'm trying to do >better. I have trouble remembering what I was trying to do when I revisit code >after a few months, let alone looking at someone else's code. And while I'll >buy that some code is self-documenting I don't buy that on a much grander >scale than a half-dozen lines or so. > >I am insistent that and code written for my department be properly indented >and that includes javascript (and I don't mean online libraries). I'm willing >to give up the fractional difference in load or execution time for code I can >decipher without developing ulcers. > >I recently had to help with some code with really outlandish variable and >field names. > (not really, but a good paraphrase) > >Name stuff so the next person that looks at the code has a clue what you're >doing. > > > >-Original Message- >From: Maureen [mailto: >mamamaur...@gmail.com >] >Sent: Wednesday, June 20, 2012 6:18 PM >To: cf-talk >Subject: Re: Best practices > > >If I wrap a large amount of code in cfoutput tags, I always comment the >starting and ending tags to describe what they wrap. It makes it easier to >match them when debugging. > >On Wed, Jun 20, 2012 at 3:05 PM, Rob Voyle < >robvo...@voyle.com >> wrote: > >> >> >>Hi folks >> >>Thanks for the input and help. >>I had not been thinking in terms of speed but of accuracy, which >>doesn't seem to be an issue. The page isn't that big that speed is >>going to be a problem. It is actually much easier to code without the >> as I have several paragraphs with variable scattered throughout. >> > > > > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:351631 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Re[2]: Best Practices
I use fusebox now. And url and form scopes becomes attributes. this makes things easy - Original Message - From: [EMAIL PROTECTED] To: CF-Talk Sent: Thursday, November 13, 2003 9:37 AM Subject: RE: Re[2]: Best Practices sometimes better not to scope (admittedly not very often) i.e. a search form where parameters can come in either the URL or FORM scope... what do you do... scope them out and have double the coding work? what would be the best practice in that case? -dc -Original Message- From: Calvin Ward [mailto:[EMAIL PROTECTED] Sent: 13 November 2003 14:25 To: CF-Talk Subject: Re: Re[2]: Best Practices The question was theoritical in nature, not everyone scopes variables, I'm sure we all realize. - Calvin - Original Message - From: Philip Arnold To: CF-Talk Sent: Thursday, November 13, 2003 7:19 AM Subject: RE: Re[2]: Best Practices > And incidentally, I wonder how it is handled if you send the > same named variable in the query string and a form field with > method POST... If it were 2 form fields with the same name, > you would typically get a comma delimited list, but I suspect > that it might not work that way with the query string and > form field technique. Well, it would hand the one that you scope it to If you ask for URL.myVar, then you'd get the URL version If you ask for form.myVar, then you'd get the Form version You DO scope your variables, don't you? _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Re[2]: Best Practices
ok ok ... promise not to do it next time :-) -Original Message- From: Calvin Ward [mailto:[EMAIL PROTECTED] Sent: 13 November 2003 14:47 To: CF-Talk Subject: Re: Re[2]: Best Practices ack, I answered this too quickly and didn't read it carefully. formurl2attributes is a good solution for that! Calvin - Original Message - From: Calvin Ward To: [EMAIL PROTECTED] Sent: Thursday, November 13, 2003 9:44 AM Subject: Re: Re[2]: Best Practices In my opinion stick with one scope, form if you are using POST. I'm curious in what circumstances a query string is superior to a hidden field from a design perspective. Thanks, Calvin - Original Message - From: [EMAIL PROTECTED] To: CF-Talk Sent: Thursday, November 13, 2003 9:37 AM Subject: RE: Re[2]: Best Practices sometimes better not to scope (admittedly not very often) i.e. a search form where parameters can come in either the URL or FORM scope... what do you do... scope them out and have double the coding work? what would be the best practice in that case? -dc -Original Message- From: Calvin Ward [mailto:[EMAIL PROTECTED] Sent: 13 November 2003 14:25 To: CF-Talk Subject: Re: Re[2]: Best Practices The question was theoritical in nature, not everyone scopes variables, I'm sure we all realize. - Calvin - Original Message - From: Philip Arnold To: CF-Talk Sent: Thursday, November 13, 2003 7:19 AM Subject: RE: Re[2]: Best Practices > And incidentally, I wonder how it is handled if you send the > same named variable in the query string and a form field with > method POST... If it were 2 form fields with the same name, > you would typically get a comma delimited list, but I suspect > that it might not work that way with the query string and > form field technique. Well, it would hand the one that you scope it to If you ask for URL.myVar, then you'd get the URL version If you ask for form.myVar, then you'd get the Form version You DO scope your variables, don't you? _ _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Re[2]: Best Practices
I think its better to pass the values in hidden form fields especially when the information being passed in the url could be tampered with or altered (change ID from "x" to "y"). Although it could potentially be done via a form, it is harder. -Original Message- From: Calvin Ward [mailto:[EMAIL PROTECTED] Sent: Thursday, November 13, 2003 9:44 AM To: CF-Talk Subject: Re: Re[2]: Best Practices In my opinion stick with one scope, form if you are using POST. I'm curious in what circumstances a query string is superior to a hidden field from a design perspective. Thanks, Calvin - Original Message - From: [EMAIL PROTECTED] To: CF-Talk Sent: Thursday, November 13, 2003 9:37 AM Subject: RE: Re[2]: Best Practices sometimes better not to scope (admittedly not very often) i.e. a search form where parameters can come in either the URL or FORM scope... what do you do... scope them out and have double the coding work? what would be the best practice in that case? -dc -Original Message- From: Calvin Ward [mailto:[EMAIL PROTECTED] Sent: 13 November 2003 14:25 To: CF-Talk Subject: Re: Re[2]: Best Practices The question was theoritical in nature, not everyone scopes variables, I'm sure we all realize. - Calvin - Original Message - From: Philip Arnold To: CF-Talk Sent: Thursday, November 13, 2003 7:19 AM Subject: RE: Re[2]: Best Practices > And incidentally, I wonder how it is handled if you send the > same named variable in the query string and a form field with > method POST... If it were 2 form fields with the same name, > you would typically get a comma delimited list, but I suspect > that it might not work that way with the query string and > form field technique. Well, it would hand the one that you scope it to If you ask for URL.myVar, then you'd get the URL version If you ask for form.myVar, then you'd get the Form version You DO scope your variables, don't you? _ _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Re[2]: Best Practices
I disagree... you should always scope your variables. It should always be clear where the value is coming from: form, url, query, whatever. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, November 13, 2003 9:38 AM To: CF-Talk Subject: RE: Re[2]: Best Practices sometimes better not to scope (admittedly not very often) i.e. a search form where parameters can come in either the URL or FORM scope... what do you do... scope them out and have double the coding work? what would be the best practice in that case? -dc -Original Message- From: Calvin Ward [mailto:[EMAIL PROTECTED] Sent: 13 November 2003 14:25 To: CF-Talk Subject: Re: Re[2]: Best Practices The question was theoritical in nature, not everyone scopes variables, I'm sure we all realize. - Calvin - Original Message - From: Philip Arnold To: CF-Talk Sent: Thursday, November 13, 2003 7:19 AM Subject: RE: Re[2]: Best Practices > And incidentally, I wonder how it is handled if you send the > same named variable in the query string and a form field with > method POST... If it were 2 form fields with the same name, > you would typically get a comma delimited list, but I suspect > that it might not work that way with the query string and > form field technique. Well, it would hand the one that you scope it to If you ask for URL.myVar, then you'd get the URL version If you ask for form.myVar, then you'd get the Form version You DO scope your variables, don't you? _ _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: Re[2]: Best Practices
ack, I answered this too quickly and didn't read it carefully. formurl2attributes is a good solution for that! Calvin - Original Message - From: Calvin Ward To: [EMAIL PROTECTED] Sent: Thursday, November 13, 2003 9:44 AM Subject: Re: Re[2]: Best Practices In my opinion stick with one scope, form if you are using POST. I'm curious in what circumstances a query string is superior to a hidden field from a design perspective. Thanks, Calvin - Original Message - From: [EMAIL PROTECTED] To: CF-Talk Sent: Thursday, November 13, 2003 9:37 AM Subject: RE: Re[2]: Best Practices sometimes better not to scope (admittedly not very often) i.e. a search form where parameters can come in either the URL or FORM scope... what do you do... scope them out and have double the coding work? what would be the best practice in that case? -dc -Original Message- From: Calvin Ward [mailto:[EMAIL PROTECTED] Sent: 13 November 2003 14:25 To: CF-Talk Subject: Re: Re[2]: Best Practices The question was theoritical in nature, not everyone scopes variables, I'm sure we all realize. - Calvin - Original Message - From: Philip Arnold To: CF-Talk Sent: Thursday, November 13, 2003 7:19 AM Subject: RE: Re[2]: Best Practices > And incidentally, I wonder how it is handled if you send the > same named variable in the query string and a form field with > method POST... If it were 2 form fields with the same name, > you would typically get a comma delimited list, but I suspect > that it might not work that way with the query string and > form field technique. Well, it would hand the one that you scope it to If you ask for URL.myVar, then you'd get the URL version If you ask for form.myVar, then you'd get the Form version You DO scope your variables, don't you? _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: Re[2]: Best Practices
In my opinion stick with one scope, form if you are using POST. I'm curious in what circumstances a query string is superior to a hidden field from a design perspective. Thanks, Calvin - Original Message - From: [EMAIL PROTECTED] To: CF-Talk Sent: Thursday, November 13, 2003 9:37 AM Subject: RE: Re[2]: Best Practices sometimes better not to scope (admittedly not very often) i.e. a search form where parameters can come in either the URL or FORM scope... what do you do... scope them out and have double the coding work? what would be the best practice in that case? -dc -Original Message- From: Calvin Ward [mailto:[EMAIL PROTECTED] Sent: 13 November 2003 14:25 To: CF-Talk Subject: Re: Re[2]: Best Practices The question was theoritical in nature, not everyone scopes variables, I'm sure we all realize. - Calvin - Original Message - From: Philip Arnold To: CF-Talk Sent: Thursday, November 13, 2003 7:19 AM Subject: RE: Re[2]: Best Practices > And incidentally, I wonder how it is handled if you send the > same named variable in the query string and a form field with > method POST... If it were 2 form fields with the same name, > you would typically get a comma delimited list, but I suspect > that it might not work that way with the query string and > form field technique. Well, it would hand the one that you scope it to If you ask for URL.myVar, then you'd get the URL version If you ask for form.myVar, then you'd get the Form version You DO scope your variables, don't you? _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: Re[2]: Best Practices
On Thursday 13 Nov 2003 14:37 pm, [EMAIL PROTECTED] wrote: > i.e. a search form where parameters can come in either the URL or FORM > scope... what do you do... scope them out and have double the coding > work? > > what would be the best practice in that case? formurl2attributes :-) -- Tom Chiverton Advanced ColdFusion Programmer Tel: +44(0)1749 834997 email: [EMAIL PROTECTED] BlueFinger Limited Underwood Business Park Wookey Hole Road, WELLS. BA5 1AF Tel: +44 (0)1749 834900 Fax: +44 (0)1749 834901 web: www.bluefinger.com Company Reg No: 4209395 Registered Office: 2 Temple Back East, Temple Quay, BRISTOL. BS1 6EG. *** This E-mail contains confidential information for the addressee only. If you are not the intended recipient, please notify us immediately. You should not use, disclose, distribute or copy this communication if received in error. No binding contract will result from this e-mail until such time as a written document is signed on behalf of the company. BlueFinger Limited cannot accept responsibility for the completeness or accuracy of this message as it has been transmitted over public networks.*** [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Re[2]: Best Practices
sometimes better not to scope (admittedly not very often) i.e. a search form where parameters can come in either the URL or FORM scope... what do you do... scope them out and have double the coding work? what would be the best practice in that case? -dc -Original Message- From: Calvin Ward [mailto:[EMAIL PROTECTED] Sent: 13 November 2003 14:25 To: CF-Talk Subject: Re: Re[2]: Best Practices The question was theoritical in nature, not everyone scopes variables, I'm sure we all realize. - Calvin - Original Message - From: Philip Arnold To: CF-Talk Sent: Thursday, November 13, 2003 7:19 AM Subject: RE: Re[2]: Best Practices > And incidentally, I wonder how it is handled if you send the > same named variable in the query string and a form field with > method POST... If it were 2 form fields with the same name, > you would typically get a comma delimited list, but I suspect > that it might not work that way with the query string and > form field technique. Well, it would hand the one that you scope it to If you ask for URL.myVar, then you'd get the URL version If you ask for form.myVar, then you'd get the Form version You DO scope your variables, don't you? _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: Re[2]: Best Practices
The question was theoritical in nature, not everyone scopes variables, I'm sure we all realize. - Calvin - Original Message - From: Philip Arnold To: CF-Talk Sent: Thursday, November 13, 2003 7:19 AM Subject: RE: Re[2]: Best Practices > And incidentally, I wonder how it is handled if you send the > same named variable in the query string and a form field with > method POST... If it were 2 form fields with the same name, > you would typically get a comma delimited list, but I suspect > that it might not work that way with the query string and > form field technique. Well, it would hand the one that you scope it to If you ask for URL.myVar, then you'd get the URL version If you ask for form.myVar, then you'd get the Form version You DO scope your variables, don't you? [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: Re[2]: Best Practices
Thanks Dave and everyone It works great! - Original Message - From: Dave Watts To: CF-Talk Sent: Thursday, November 13, 2003 8:37 AM Subject: RE: Re[2]: Best Practices > I suppose it seems that since the url parameter is not > part of the form itself, isn't it a GET, even when you've > specified a POST as the method in the form? No. If you look at the text of the HTTP request in such a case, the first line would look something like this: POST /myfile.cfm?foo=bar ... and your form fields would be in the HTTP request body. > And incidentally, I wonder how it is handled if you send the > same named variable in the query string and a form field with > method POST... If it were 2 form fields with the same name, > you would typically get a comma delimited list, but I suspect > that it might not work that way with the query string and > form field technique. You'd have to use the appropriate scope prefix to get to the one that you want, in that case. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Re[2]: Best Practices
> I suppose it seems that since the url parameter is not > part of the form itself, isn't it a GET, even when you've > specified a POST as the method in the form? No. If you look at the text of the HTTP request in such a case, the first line would look something like this: POST /myfile.cfm?foo=bar ... and your form fields would be in the HTTP request body. > And incidentally, I wonder how it is handled if you send the > same named variable in the query string and a form field with > method POST... If it were 2 form fields with the same name, > you would typically get a comma delimited list, but I suspect > that it might not work that way with the query string and > form field technique. You'd have to use the appropriate scope prefix to get to the one that you want, in that case. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: Re[2]: Best Practices
Calvin Ward said: > I suppose it seems that since the url parameter is not part of the > form itself, isn't it a GET, even when you've specified a POST as > the method in the form? HTTP requests can only have one verb, so a request is either a GET or a POST (or a HEAD, OPTIONS, PUT etc.). Please refer to RFC 2616 for details on the formal definition of HTTP. The presence of parameters in the URL is not related to the verb of the request. > And incidentally, I wonder how it is handled if you send the same > named variable in the query string and a form field with method > POST... If it were 2 form fields with the same name, you would > typically get a comma delimited list, but I suspect that it might > not work that way with the query string and form field technique. I would expect one to show up in the form structure and one to show up in the URL structure. But it is easy to test ;-) Jochem [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Re[2]: Best Practices
Doesn't everyone? :-) -Original Message- From: Philip Arnold [mailto:[EMAIL PROTECTED] Sent: Thursday, November 13, 2003 7:20 AM To: CF-Talk Subject: RE: Re[2]: Best Practices > And incidentally, I wonder how it is handled if you send the > same named variable in the query string and a form field with > method POST... If it were 2 form fields with the same name, > you would typically get a comma delimited list, but I suspect > that it might not work that way with the query string and > form field technique. Well, it would hand the one that you scope it to If you ask for URL.myVar, then you'd get the URL version If you ask for form.myVar, then you'd get the Form version You DO scope your variables, don't you? _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Re[2]: Best Practices
> And incidentally, I wonder how it is handled if you send the > same named variable in the query string and a form field with > method POST... If it were 2 form fields with the same name, > you would typically get a comma delimited list, but I suspect > that it might not work that way with the query string and > form field technique. Well, it would hand the one that you scope it to If you ask for URL.myVar, then you'd get the URL version If you ask for form.myVar, then you'd get the Form version You DO scope your variables, don't you? [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: Re[2]: Best Practices
I suppose it seems that since the url parameter is not part of the form itself, isn't it a GET, even when you've specified a POST as the method in the form? And incidentally, I wonder how it is handled if you send the same named variable in the query string and a form field with method POST... If it were 2 form fields with the same name, you would typically get a comma delimited list, but I suspect that it might not work that way with the query string and form field technique. - Calvin - Original Message - From: Jochem van Dieten To: CF-Talk Sent: Thursday, November 13, 2003 6:19 AM Subject: Re: Re[2]: Best Practices Calvin Ward said: > However, it doesn't feel like it is a good solution. > > What does the HTTP specification say about performing GET and POST > operations on the same request? That it is not possible. HTTP requests can only have one verb. Jochem [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: Re[2]: Best Practices
Calvin Ward said: > However, it doesn't feel like it is a good solution. > > What does the HTTP specification say about performing GET and POST > operations on the same request? That it is not possible. HTTP requests can only have one verb. Jochem [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: Re[2]: Best Practices
However, it doesn't feel like it is a good solution. What does the HTTP specification say about performing GET and POST operations on the same request? How does every browser version and OS combination handle GET and POST in the same HTTP call? Thoughts? - Calvin - Original Message - From: Ubqtous To: CF-Talk Sent: Wednesday, November 12, 2003 8:07 PM Subject: Re[2]: Best Practices Mickael, On Wednesday, November 12, 2003, 7:41:27 PM, you wrote: M> But my form method is "post" not "get" wouldn't that cause that to M> fail? Nope... you can do both! ~ Ubqtous ~ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Re[2]: Best Practices
> Remember that in CFMX 6.1 the "post" method has been > deprecated. As a result you do not need to use the > method attribute as it defaults to post anyway. This isn't the case. POST and GET are ways to make HTTP requests, and CFMX can't deprecate them - it has nothing to do with how the browser sends data to the server. If you're referring to the CFFORM tag, which generates an HTML form for you, it will always generate a form with METHOD="POST", but this doesn't mean anything has been deprecated - this has always been the case with CFFORM, as far as I can recall. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Re[2]: Best Practices
Remember that in CFMX 6.1 the "post" method has been deprecated. As a result you do not need to use the method attribute as it defaults to post anyway. You would still require it for "get" and in my opinion it is good coding practice to still use the method="post" attribute when writng your code for legibility at least. Peter Tilbrook ColdFusion Applications Developer ColdGen Internet Solutions Manager, ACT and Region ColdFusion Users Group - http://www.actcfug.com 4/73 Tharwa Road Queanbeyan, NSW, 2620 AUSTRALIA Telephone: +61-2-6284-2727 Mobile: +61-0439-401-823 E-mail: [EMAIL PROTECTED] [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re[2]: Best Practices
Mickael, On Wednesday, November 12, 2003, 7:41:27 PM, you wrote: M> But my form method is "post" not "get" wouldn't that cause that to M> fail? Nope... you can do both! ~ Ubqtous ~ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Re[2]: Best Practices - Fusion Authority back!
MD, that's great! A search facility would be nice also :) -Original Message- From: Jim Priest [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 6 February 2002 9:21 AM To: CF-Talk Subject: Re[2]: Best Practices - Fusion Authority back! Sweet!! I've missed this in my mailbox! Looking forward to seeing new content! jim On Tuesday, February 05, 2002, Michael wrote: MD> Your in luck. An index of Fusion Authority articles was just put up. In it MD> the ability to comment and rate articles. We're getting back into th e MD> publishing with an issue tonight. __ Why Share? Dedicated Win 2000 Server · PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc 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[2]: Best Practices - Fusion Authority back!
Sweet!! I've missed this in my mailbox! Looking forward to seeing new content! jim On Tuesday, February 05, 2002, Michael wrote: MD> Your in luck. An index of Fusion Authority articles was just put up. In it MD> the ability to comment and rate articles. We're getting back into the MD> publishing with an issue tonight. __ Get Your Own Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb 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