On Thu, 11 Nov 2004 12:58:39 -0800, Ian Skinner
<[EMAIL PROTECTED]> wrote:
> Interesting, I wrote the following simple tests and they all work just fine 
> in MX 6.1.  And here I've always gone out of my way to declare new 
> structures, such as the first example.
> 
> <cfsilent>
>         <cfapplication name="FooBar" sessionmanagement="yes">
> </cfsilent><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
> "http://www.w3.org/TR/html4/loose.dtd";>
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
> <title>Struct Test</title>
> </head>
> 
> <body>
> <cfset session.foo = structNew()>
> <cfset session.foo.bar="somethingElse">
> 
> <cfset session.what.now="something Entirly Different">
> <cfset session.something.complete.silly.I.really.mean.it = "now wasn't that 
> silly">
> <cfset session.something.different = "and now a different path">
> 
> <cfdump var="#session#">
> </body>
> </html>
> 

Sure, this definitely works in MX (6.0 and 6.1, for that matter), but
I'd discourage the later piece of code for one simple reason:
readability. The nice part about explicitly using structNew() is that
you know what sort of datatype you're dealing with as opposed to the
latter snippet where you have to implicitly know MX's rule that
variable names with dots in them are automatically structures. You
admitted yourself (I believe) that you weren't aware of the rule until
your test, and I'm sure you're a pretty good developer.

Either way works, but I always keep in mind that I'm not the only one
that might have to work with my code.

Regards,
Dave.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:184041
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to