Re: Shocked!
Yep. I agree with Eric. Ravi. Eric Roberts wrote: > I think the problem is that some folks are confusing scope with type... > > Eric > > -Original Message- > From: Claude Schneegans [mailto:[EMAIL PROTECTED] > Sent: Tuesday, May 22, 2007 8:46 AM > To: CF-Talk > Subject: Re: Shocked! > > >>I come from a C#/Java background, > > Your background is probably to light, I've worked with tens of languages, > including Fortran, Algol, Pascal, Lisp, Snobol, C, C++, Java, and I > don't remember > any in which scoping was mandatory or even possible for parameters. > > -- --- Ravi Gehlot. Sr. Management Sunshine Technology Solutions, LLC http://www.sunshinetechsolutions.com/ --- Confidentiality Notice: This message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and delete any copies of this message. ~| Macromedia ColdFusion MX7 Upgrade to MX7 & experience time-saving features, more productivity. http://www.adobe.com/products/coldfusion?sdid=RVJW Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278931 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Shocked!
I think the problem is that some folks are confusing scope with type... Eric -Original Message- From: Claude Schneegans [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 22, 2007 8:46 AM To: CF-Talk Subject: Re: Shocked! >>I come from a C#/Java background, Your background is probably to light, I've worked with tens of languages, including Fortran, Algol, Pascal, Lisp, Snobol, C, C++, Java, and I don't remember any in which scoping was mandatory or even possible for parameters. -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. ~| Deploy Web Applications Quickly across the enterprise with ColdFusion MX7 & Flex 2 Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278928 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Shocked!
Claude: You obviously misunderstood what I was saying, and 10+ years of experience isn't light. I wasn't looking, or asking, for unwarranted criticism when I sent this message. - Steve - Original Message Follows - From: Claude Schneegans <[EMAIL PROTECTED]> To: CF-Talk Subject: Re: Shocked! Date: Tue, 22 May 2007 09:46:05 -0400 > >>I come from a C#/Java background, > > Your background is probably to light, I've worked with > tens of languages, including Fortran, Algol, Pascal, Lisp, > Snobol, C, C++, Java, and I don't remember > any in which scoping was mandatory or even possible for > parameters. ~| Create Web Applications With ColdFusion MX7 & Flex 2. Build powerful, scalable RIAs. Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278863 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Shocked!
>>I come from a C#/Java background, Your background is probably to light, I've worked with tens of languages, including Fortran, Algol, Pascal, Lisp, Snobol, C, C++, Java, and I don't remember any in which scoping was mandatory or even possible for parameters. -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. ~| ColdFusion MX7 by Adobe® Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. Free Trial. http://www.adobe.com/products/coldfusion?sdid=RVJV Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278851 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Shocked!
On 5/21/07, Steve Brownlee wrote: > It just took me > off guard more than anything and made all the red flags that have been > pounded into my brain start waving. As well they should. Off the top of my head I can't think of a more effective way to obfuscate code... and that includes cfencrypt... or fusebox oh my here we go... Where's that UNsend button?!? -- [EMAIL PROTECTED] Janitor, The Robertson Team mysecretbase.com ~| Create robust enterprise, web RIAs. Upgrade & integrate Adobe Coldfusion MX7 with Flex 2 http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278827 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Shocked!
I'm not shocked that ColdFusion does it once I stopped and thought about it. I come from a C#/Java background, and even though I love CF, I always scope my variables because I'm so used scoping being enforced. It just took me off guard more than anything and made all the red flags that have been pounded into my brain start waving. Steve Brownlee http://www.fusioncube.net > -Original Message- > From: Charlie Griefer [mailto:[EMAIL PROTECTED] > Sent: Monday, May 21, 2007 12:13 PM > To: CF-Talk > Subject: Re: Shocked! > > if you were aware that CF does a top-down search through the > myriad of scopes... why are you shocked? ~| Create robust enterprise, web RIAs. Upgrade & integrate Adobe Coldfusion MX7 with Flex 2 http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278825 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Shocked!
Dave Anderson wrote: > How would that be dangerous? Because of potential collision with a variable > of the same name in another scope? Yes. > Is the order for var name resolution the same within a cffunction as it is > elsewhere? Does the arguments scope not get checked first inside a > cffunction? CF 6 : 1. Arguments 2. Variables (local scope) 3. CGI 4. URL 5. Form 6. Cookie 7. Client http://livedocs.adobe.com/coldfusion/6/Developing_ColdFusion_MX_Applications_with_CFML/Variables7.htm#1100240 CF 7: 1. Function local (UDFs and CFCs only) 2. Arguments 3. Variables (local scope) 4. CGI 5. Cffile 6. URL 7. Form 8. Cookie 9. Client http://livedocs.adobe.com/coldfusion/7/htmldocs/0914.htm#1134503 Jochem ~| Macromedia ColdFusion MX7 Upgrade to MX7 & experience time-saving features, more productivity. http://www.adobe.com/products/coldfusion?sdid=RVJW Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278822 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Shocked!
I was maybe thinking of adding it to the cfapplication tag to define the rule per application to cascade through all pages. "strictscoping=true" That aside and in respect to all pages independently it wouldn't be very nice to have say 10 pages strict and 10 pages not? "This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant, Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business, Registered in England, Number 678540. It contains information which is confidential and may also be privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s) please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you have received this communication in error please return it to the sender or call our switchboard on +44 (0) 20 89107910. The opinions expressed within this communication are not necessarily those expressed by Reed Exhibitions." Visit our website at http://www.reedexpo.com -Original Message- From: Sean Corfield To: CF-Talk Sent: Mon May 21 22:12:08 2007 Subject: Re: Shocked! On 5/21/07, Robertson-Ravo, Neil (RX) <[EMAIL PROTECTED]> wrote: > Nice... Or in the application.cfm/cfc. Either way is nice. No, cfprocessingdirective tells the compiler how to process a single file. You could have Application.cfm processed differently to you main.cfm page. All pages are compiled independently. -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "If you're not annoying somebody, you're not really alive." -- Margaret Atwood ~| Create robust enterprise, web RIAs. Upgrade & integrate Adobe Coldfusion MX7 with Flex 2 http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278820 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Shocked!
On 5/21/07, Robertson-Ravo, Neil (RX) <[EMAIL PROTECTED]> wrote: > Nice... Or in the application.cfm/cfc. Either way is nice. No, cfprocessingdirective tells the compiler how to process a single file. You could have Application.cfm processed differently to you main.cfm page. All pages are compiled independently. -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "If you're not annoying somebody, you're not really alive." -- Margaret Atwood ~| Upgrade to Adobe ColdFusion MX7 The most significant release in over 10 years. Upgrade & see new features. http://www.adobe.com/products/coldfusion?sdid=RVJR Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278819 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Shocked!
I do not really see anything bad with leaving off the arguments scope even though I never do it. What amazes me is when I see a UDF that references a variable within the variables scope of the page calling it. An example is this current app I have been brought in on recently. Within the applciation.cfm it has some UDFs and within one of those it has things like #someVar# well #someVar# is not an argument nor is it even a variable set within the page. What it is, is some variable set on some page within the application that later calls that UDF. Things like that are fun to go and debug, fun if you like headaches. Things like that are also why I tend to always put in a scope if one is available to put in. On 5/21/07, Rebecca Younes <[EMAIL PROTECTED]> wrote: > > You should note that function arguments are automatically placed in the > local function scope, so there is nothing conceptually wrong with using the > unprefixed form in this case. Obviously, since it's the first scope checked, > there is no performance impact either. > > ~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278818 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Shocked!
You should note that function arguments are automatically placed in the local function scope, so there is nothing conceptually wrong with using the unprefixed form in this case. Obviously, since it's the first scope checked, there is no performance impact either. ~| Deploy Web Applications Quickly across the enterprise with ColdFusion MX7 & Flex 2 Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278817 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Shocked!
This whole thread reminds me of two CFDJ articles. One by Simon Horwith in the January edition, "ColdFusion: So easy, even a caveman can do it". And another article by Brandon Harper, where ColdFusion and Java are compared to a razor blade and a pair of safety scissors respectively. CF allows for quick and dirty, but you may just cut yourself in the process if you don't watch out... ~Brad ~| Macromedia ColdFusion MX7 Upgrade to MX7 & experience time-saving features, more productivity. http://www.adobe.com/products/coldfusion?sdid=RVJW Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278816 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Shocked!
I wonder if the simple hill folk who cannot learn to scope vars would put up with a cfprocessingdirective statement or any other developer-accessible feature that impacts so severely their free-love style of development. It would severely pu the screws to some kinds of application 'structure'. You know the kind I mean... Where you not only don't scope, but you can't because Cheeta and Tarzan decided to accept inputs to a given var from the url, variables and form scopes and didn't know how to ... ah... don't get me started. -- [EMAIL PROTECTED] Janitor, The Robertson Team mysecretbase.com ~| Create Web Applications With ColdFusion MX7 & Flex 2. Build powerful, scalable RIAs. Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278813 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Shocked!
I've been able to measure significant speed increase in structkeyexists over isdefined and I've assumed it was related to the latter performing scope hunts. ~Brad -Original Message- From: Robertson-Ravo, Neil (RX) [mailto:[EMAIL PROTECTED] Sent: Monday, May 21, 2007 2:34 PM To: CF-Talk Subject: Re: Shocked! Yeah, if it performs far far better then for sure, let's enforce it! ~| Create Web Applications With ColdFusion MX7 & Flex 2. Build powerful, scalable RIAs. Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278812 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Shocked!
Nice... Or in the application.cfm/cfc. Either way is nice. "This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant, Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business, Registered in England, Number 678540. It contains information which is confidential and may also be privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s) please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you have received this communication in error please return it to the sender or call our switchboard on +44 (0) 20 89107910. The opinions expressed within this communication are not necessarily those expressed by Reed Exhibitions." Visit our website at http://www.reedexpo.com -Original Message- From: Peterson, Chris To: CF-Talk Sent: Mon May 21 20:41:19 2007 Subject: RE: Shocked! How about creating a http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278811 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Shocked!
How about creating a http://www.adobe.com/products/coldfusion?sdid=RVJR Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278810 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Shocked!
Infinite monkeys and infinite typewriters... :-) "This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant, Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business, Registered in England, Number 678540. It contains information which is confidential and may also be privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s) please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you have received this communication in error please return it to the sender or call our switchboard on +44 (0) 20 89107910. The opinions expressed within this communication are not necessarily those expressed by Reed Exhibitions." Visit our website at http://www.reedexpo.com -Original Message- From: Matt Robertson To: CF-Talk Sent: Mon May 21 20:34:47 2007 Subject: Re: Shocked! If CF had a "demand scoping" option it would break most of the CF code out there if what I've seen is any indicator. 'course, since I am a troubleshooter, the reason I am working on a given lump of code in the first place is because the original code was developed by chimps. -- [EMAIL PROTECTED] Janitor, The Robertson Team mysecretbase.com ~| Create Web Applications With ColdFusion MX7 & Flex 2. Build powerful, scalable RIAs. Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278809 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Shocked!
I know :-) I just mean the whole idea enforcing something etc... Don't get me wrong, I think it works fine as it is though.. It makes sense for what it is. "This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant, Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business, Registered in England, Number 678540. It contains information which is confidential and may also be privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s) please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you have received this communication in error please return it to the sender or call our switchboard on +44 (0) 20 89107910. The opinions expressed within this communication are not necessarily those expressed by Reed Exhibitions." Visit our website at http://www.reedexpo.com -Original Message- From: Christopher Jordan To: CF-Talk Sent: Mon May 21 19:53:39 2007 Subject: Re: Shocked! Scope != type Robertson-Ravo, Neil (RX) wrote: > It would defeat the purpose and wonder of ColdFusion being typeless etc. > > > > > "This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant, > Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business, > Registered in England, Number 678540. It contains information which is > confidential and may also be privileged. It is for the exclusive use of the > intended recipient(s). If you are not the intended recipient(s) please note > that any form of distribution, copying or use of this communication or the > information in it is strictly prohibited and may be unlawful. If you have > received this communication in error please return it to the sender or call > our switchboard on +44 (0) 20 89107910. The opinions expressed within this > communication are not necessarily those expressed by Reed Exhibitions." > Visit our website at http://www.reedexpo.com > > -Original Message- > From: Gaulin, Mark > To: CF-Talk > Sent: Mon May 21 18:26:07 2007 > Subject: RE: Shocked! > > Yeah, I wish there was an admin setting that would REQUIRE all variables > to be scoped (like VB's "Option Explicit"). Of course, I sometimes get > lazy and don't include the "variables." scope prefix, so I'd get stung > by this once in a while too, but hey, that would be a good thing. > > Mark > > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Monday, May 21, 2007 1:09 PM > To: CF-Talk > Subject: Shocked! > > I just looked at some code from another developer and noticed that they > were accessing variables in the arguments scope witout using the > ARGUMENTS. prefix to the variable name. I was about to wander over to > him and ask him why his application wasn't working when I decided I'd > better test it first. > > I was shocked to see my test function work. I just can't believe that > Adobe would even expose those variables without a scope prefix. I know > that it does a top-down search through the myriad of scopes, but this > just seems flat out dangerous. > > Was anyone else aware of this? > > - Steve > > > > > > ~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278808 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Shocked!
Yeah, if it performs far far better then for sure, let's enforce it! "This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant, Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business, Registered in England, Number 678540. It contains information which is confidential and may also be privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s) please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you have received this communication in error please return it to the sender or call our switchboard on +44 (0) 20 89107910. The opinions expressed within this communication are not necessarily those expressed by Reed Exhibitions." Visit our website at http://www.reedexpo.com -Original Message- From: Gert Franz To: CF-Talk Sent: Mon May 21 20:15:21 2007 Subject: Re: Shocked! Railo has exactly this setting. You can either let Railo scan all scopes like CFML, or for example the variables scope only. In addition in Railo you can turn off implicit query scanning as well. So you would recieve an error when you execute the following: SELECT name, firstname from addresses name: #firstname# #name# My two notes on this. Not only is scoping variables easier to use, it is much more performant. Just imagine you would use a variable from the client scope without scoping it. CF would need to scan through 8 other scopes first in order to find it first. So to round up the example before just use: name: #getAddresses.firstname# #getAddresses.name# Greetings / Grüsse Gert Franz Customer Care Railo Technologies GmbH [EMAIL PROTECTED] www.railo.ch Join our Mailing List / Treten Sie unserer Mailingliste bei: deutsch: http://de.groups.yahoo.com/group/railo/ english: http://groups.yahoo.com/group/railo_talk/ Gaulin, Mark schrieb: > Yeah, I wish there was an admin setting that would REQUIRE all variables > to be scoped (like VB's "Option Explicit"). Of course, I sometimes get > lazy and don't include the "variables." scope prefix, so I'd get stung > by this once in a while too, but hey, that would be a good thing. > > Mark > > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Monday, May 21, 2007 1:09 PM > To: CF-Talk > Subject: Shocked! > > I just looked at some code from another developer and noticed that they > were accessing variables in the arguments scope witout using the > ARGUMENTS. prefix to the variable name. I was about to wander over to > him and ask him why his application wasn't working when I decided I'd > better test it first. > > I was shocked to see my test function work. I just can't believe that > Adobe would even expose those variables without a scope prefix. I know > that it does a top-down search through the myriad of scopes, but this > just seems flat out dangerous. > > Was anyone else aware of this? > > - Steve > > > > ~| Deploy Web Applications Quickly across the enterprise with ColdFusion MX7 & Flex 2 Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278807 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Shocked!
If CF had a "demand scoping" option it would break most of the CF code out there if what I've seen is any indicator. 'course, since I am a troubleshooter, the reason I am working on a given lump of code in the first place is because the original code was developed by chimps. -- [EMAIL PROTECTED] Janitor, The Robertson Team mysecretbase.com ~| Deploy Web Applications Quickly across the enterprise with ColdFusion MX7 & Flex 2 Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278806 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Shocked!
It's all about having options... I'd like to see some just like the existing admin option that checks for invalid cf tag attributes... you can run with it off in production but on in development. (Did that option go away? I remember that back in CF4.5 or so...) I just added this to the Wish list on Adobe... Mark -Original Message- From: Robertson-Ravo, Neil (RX) [mailto:[EMAIL PROTECTED] Sent: Monday, May 21, 2007 2:04 PM To: CF-Talk Subject: Re: Shocked! Well yeah, I meant more the restriction etc I tend to scope them all anyway, just force of habit but for ColdFusion to have a strict / non-strict policy would be a step backward I think. It may happen though, you just don't know! "This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant, Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business, Registered in England, Number 678540. It contains information which is confidential and may also be privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s) please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you have received this communication in error please return it to the sender or call our switchboard on +44 (0) 20 89107910. The opinions expressed within this communication are not necessarily those expressed by Reed Exhibitions." Visit our website at http://www.reedexpo.com -Original Message- From: Charlie Griefer To: CF-Talk Sent: Mon May 21 18:38:12 2007 Subject: Re: Shocked! On 5/21/07, Robertson-Ravo, Neil (RX) <[EMAIL PROTECTED]> wrote: > It would defeat the purpose and wonder of ColdFusion being typeless etc. No it wouldn't. You still wouldn't have to declare a variable as a type of variable. Just the context to which it belongs. #variables.myVar# could be a string. could be an int. doesn't matter tho... you know where it lives :) -- Charlie Griefer "...All the world shall be your enemy, Prince with a Thousand Enemies, and whenever they catch you, they will kill you. But first they must catch you, digger, listener, runner, prince with a swift warning. Be cunning and full of tricks and your people shall never be destroyed." ~| Macromedia ColdFusion MX7 Upgrade to MX7 & experience time-saving features, more productivity. http://www.adobe.com/products/coldfusion?sdid=RVJW Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278803 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Shocked!
Railo has exactly this setting. You can either let Railo scan all scopes like CFML, or for example the variables scope only. In addition in Railo you can turn off implicit query scanning as well. So you would recieve an error when you execute the following: SELECT name, firstname from addresses name: #firstname# #name# My two notes on this. Not only is scoping variables easier to use, it is much more performant. Just imagine you would use a variable from the client scope without scoping it. CF would need to scan through 8 other scopes first in order to find it first. So to round up the example before just use: name: #getAddresses.firstname# #getAddresses.name# Greetings / Grüsse Gert Franz Customer Care Railo Technologies GmbH [EMAIL PROTECTED] www.railo.ch Join our Mailing List / Treten Sie unserer Mailingliste bei: deutsch: http://de.groups.yahoo.com/group/railo/ english: http://groups.yahoo.com/group/railo_talk/ Gaulin, Mark schrieb: > Yeah, I wish there was an admin setting that would REQUIRE all variables > to be scoped (like VB's "Option Explicit"). Of course, I sometimes get > lazy and don't include the "variables." scope prefix, so I'd get stung > by this once in a while too, but hey, that would be a good thing. > > Mark > > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Monday, May 21, 2007 1:09 PM > To: CF-Talk > Subject: Shocked! > > I just looked at some code from another developer and noticed that they > were accessing variables in the arguments scope witout using the > ARGUMENTS. prefix to the variable name. I was about to wander over to > him and ask him why his application wasn't working when I decided I'd > better test it first. > > I was shocked to see my test function work. I just can't believe that > Adobe would even expose those variables without a scope prefix. I know > that it does a top-down search through the myriad of scopes, but this > just seems flat out dangerous. > > Was anyone else aware of this? > > - Steve > > > > ~| Create Web Applications With ColdFusion MX7 & Flex 2. Build powerful, scalable RIAs. Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278802 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Shocked!
Scope != type Robertson-Ravo, Neil (RX) wrote: > It would defeat the purpose and wonder of ColdFusion being typeless etc. > > > > > "This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant, > Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business, > Registered in England, Number 678540. It contains information which is > confidential and may also be privileged. It is for the exclusive use of the > intended recipient(s). If you are not the intended recipient(s) please note > that any form of distribution, copying or use of this communication or the > information in it is strictly prohibited and may be unlawful. If you have > received this communication in error please return it to the sender or call > our switchboard on +44 (0) 20 89107910. The opinions expressed within this > communication are not necessarily those expressed by Reed Exhibitions." > Visit our website at http://www.reedexpo.com > > -Original Message- > From: Gaulin, Mark > To: CF-Talk > Sent: Mon May 21 18:26:07 2007 > Subject: RE: Shocked! > > Yeah, I wish there was an admin setting that would REQUIRE all variables > to be scoped (like VB's "Option Explicit"). Of course, I sometimes get > lazy and don't include the "variables." scope prefix, so I'd get stung > by this once in a while too, but hey, that would be a good thing. > > Mark > > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Monday, May 21, 2007 1:09 PM > To: CF-Talk > Subject: Shocked! > > I just looked at some code from another developer and noticed that they > were accessing variables in the arguments scope witout using the > ARGUMENTS. prefix to the variable name. I was about to wander over to > him and ask him why his application wasn't working when I decided I'd > better test it first. > > I was shocked to see my test function work. I just can't believe that > Adobe would even expose those variables without a scope prefix. I know > that it does a top-down search through the myriad of scopes, but this > just seems flat out dangerous. > > Was anyone else aware of this? > > - Steve > > > > > > ~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278800 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Shocked!
Hardly shocking. Nor dangerous. coldfusion looks at the arguments and var scoped variables FIRST, and prevents you from creating var scoped variables with the same name as arguments. So it's no more or less dangerous than anything else CF does with regards to variable scoping. I'm not very consistent about prefixing arguments variables with "arguments." in my code... off the top of my head, I can't tell you when I do it and when I don't.. I can only say that I do it sometimes, and other times I don't :) Rick ~| Upgrade to Adobe ColdFusion MX7 The most significant release in over 10 years. Upgrade & see new features. http://www.adobe.com/products/coldfusion?sdid=RVJR Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278795 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Shocked!
Well yeah, I meant more the restriction etc I tend to scope them all anyway, just force of habit but for ColdFusion to have a strict / non-strict policy would be a step backward I think. It may happen though, you just don't know! "This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant, Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business, Registered in England, Number 678540. It contains information which is confidential and may also be privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s) please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you have received this communication in error please return it to the sender or call our switchboard on +44 (0) 20 89107910. The opinions expressed within this communication are not necessarily those expressed by Reed Exhibitions." Visit our website at http://www.reedexpo.com -Original Message- From: Charlie Griefer To: CF-Talk Sent: Mon May 21 18:38:12 2007 Subject: Re: Shocked! On 5/21/07, Robertson-Ravo, Neil (RX) <[EMAIL PROTECTED]> wrote: > It would defeat the purpose and wonder of ColdFusion being typeless etc. No it wouldn't. You still wouldn't have to declare a variable as a type of variable. Just the context to which it belongs. #variables.myVar# could be a string. could be an int. doesn't matter tho... you know where it lives :) -- Charlie Griefer "...All the world shall be your enemy, Prince with a Thousand Enemies, and whenever they catch you, they will kill you. But first they must catch you, digger, listener, runner, prince with a swift warning. Be cunning and full of tricks and your people shall never be destroyed." ~| Create robust enterprise, web RIAs. Upgrade & integrate Adobe Coldfusion MX7 with Flex 2 http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278793 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Shocked!
On 5/21/07, Robertson-Ravo, Neil (RX) <[EMAIL PROTECTED]> wrote: > It would defeat the purpose and wonder of ColdFusion being typeless etc. No it wouldn't. You still wouldn't have to declare a variable as a type of variable. Just the context to which it belongs. #variables.myVar# could be a string. could be an int. doesn't matter tho... you know where it lives :) -- Charlie Griefer "...All the world shall be your enemy, Prince with a Thousand Enemies, and whenever they catch you, they will kill you. But first they must catch you, digger, listener, runner, prince with a swift warning. Be cunning and full of tricks and your people shall never be destroyed." ~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278783 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Shocked!
It would defeat the purpose and wonder of ColdFusion being typeless etc. "This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant, Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business, Registered in England, Number 678540. It contains information which is confidential and may also be privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s) please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you have received this communication in error please return it to the sender or call our switchboard on +44 (0) 20 89107910. The opinions expressed within this communication are not necessarily those expressed by Reed Exhibitions." Visit our website at http://www.reedexpo.com -Original Message- From: Gaulin, Mark To: CF-Talk Sent: Mon May 21 18:26:07 2007 Subject: RE: Shocked! Yeah, I wish there was an admin setting that would REQUIRE all variables to be scoped (like VB's "Option Explicit"). Of course, I sometimes get lazy and don't include the "variables." scope prefix, so I'd get stung by this once in a while too, but hey, that would be a good thing. Mark -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, May 21, 2007 1:09 PM To: CF-Talk Subject: Shocked! I just looked at some code from another developer and noticed that they were accessing variables in the arguments scope witout using the ARGUMENTS. prefix to the variable name. I was about to wander over to him and ask him why his application wasn't working when I decided I'd better test it first. I was shocked to see my test function work. I just can't believe that Adobe would even expose those variables without a scope prefix. I know that it does a top-down search through the myriad of scopes, but this just seems flat out dangerous. Was anyone else aware of this? - Steve ~| Upgrade to Adobe ColdFusion MX7 The most significant release in over 10 years. Upgrade & see new features. http://www.adobe.com/products/coldfusion?sdid=RVJR Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278780 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Shocked!
FYI the same principle applies when using CFQuery in case you hadn't noticed. You don't need to scope the variable to the query as it's set locally. !k -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, May 21, 2007 11:09 AM To: CF-Talk Subject: Shocked! I just looked at some code from another developer and noticed that they were accessing variables in the arguments scope witout using the ARGUMENTS. prefix to the variable name. I was about to wander over to him and ask him why his application wasn't working when I decided I'd better test it first. I was shocked to see my test function work. I just can't believe that Adobe would even expose those variables without a scope prefix. I know that it does a top-down search through the myriad of scopes, but this just seems flat out dangerous. Was anyone else aware of this? - Steve ~| Create Web Applications With ColdFusion MX7 & Flex 2. Build powerful, scalable RIAs. Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278779 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Shocked!
Yeah, I wish there was an admin setting that would REQUIRE all variables to be scoped (like VB's "Option Explicit"). Of course, I sometimes get lazy and don't include the "variables." scope prefix, so I'd get stung by this once in a while too, but hey, that would be a good thing. Mark -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, May 21, 2007 1:09 PM To: CF-Talk Subject: Shocked! I just looked at some code from another developer and noticed that they were accessing variables in the arguments scope witout using the ARGUMENTS. prefix to the variable name. I was about to wander over to him and ask him why his application wasn't working when I decided I'd better test it first. I was shocked to see my test function work. I just can't believe that Adobe would even expose those variables without a scope prefix. I know that it does a top-down search through the myriad of scopes, but this just seems flat out dangerous. Was anyone else aware of this? - Steve ~| Create Web Applications With ColdFusion MX7 & Flex 2. Build powerful, scalable RIAs. Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278777 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Shocked!
On 5/21/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I was shocked to see my test function work. I just can't > believe that Adobe would even expose those variables without > a scope prefix. I know that it does a top-down search > through the myriad of scopes, but this just seems flat out > dangerous. Read the docs: http://livedocs.adobe.com/coldfusion/7/htmldocs/0914.htm Copied here for the lazy people :) Evaluating unscoped variables If you use a variable name without a scope prefix, ColdFusion checks the scopes in the following order to find the variable: 1. Function local (UDFs and CFCs only) 2. Arguments 3. Variables (local scope) 4. CGI 5. Cffile 6. URL 7. Form 8. Cookie 9. Client -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "If you're not annoying somebody, you're not really alive." -- Margaret Atwood ~| Deploy Web Applications Quickly across the enterprise with ColdFusion MX7 & Flex 2 Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278775 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Shocked!
How would that be dangerous? Because of potential collision with a variable of the same name in another scope? Is the order for var name resolution the same within a cffunction as it is elsewhere? Does the arguments scope not get checked first inside a cffunction? >a scope prefix. I know that it does a top-down search >through the myriad of scopes, but this just seems flat out >dangerous. > >Was anyone else aware of this? > >- Steve ~| Macromedia ColdFusion MX7 Upgrade to MX7 & experience time-saving features, more productivity. http://www.adobe.com/products/coldfusion?sdid=RVJW Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278774 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Shocked!
if you were aware that CF does a top-down search through the myriad of scopes... why are you shocked? On 5/21/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I just looked at some code from another developer and > noticed that they were accessing variables in the arguments > scope witout using the ARGUMENTS. prefix to the variable > name. I was about to wander over to him and ask him why his > application wasn't working when I decided I'd better test it > first. > > I was shocked to see my test function work. I just can't > believe that Adobe would even expose those variables without > a scope prefix. I know that it does a top-down search > through the myriad of scopes, but this just seems flat out > dangerous. > > Was anyone else aware of this? > > - Steve > > ~| Deploy Web Applications Quickly across the enterprise with ColdFusion MX7 & Flex 2 Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278772 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4