I think the problem began when Macromedia chose the name "this", which
really operates in two separate modes. On one hand, it's a public scope.
On the other hand, it's a reference to the object created from the CFC.
Worse, by choosing the name, "this", they borrow the terminology from
Java while redefining its meaning. Yes, I know Java and CF are different
things, but why have "this" have such ambiguous meaning (sometimes a
scope, sometimes a reference) when it could always be a reference to the
object (as in Java). Then, "this.firstName" would refer to an *instance*
variable of the object defined by "this".

Probably water under the bridge, but I really wish they hadn't done
that.

Hal Helms
"Java for CF Programmers" class 
in Las Vegas, August 18-22
www.halhelms.com

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Nathan Dintenfass
Sent: Wednesday, July 30, 2003 5:37 PM
To: [EMAIL PROTECTED]
Subject: RE: [CFCDev] "this" scope vs. unnamed


OK -- but let's not confuse the matter here.  Are you advocating storing
things like "firstName" as public data members?  If not, you might want
to clarify since the people asking the questions aren't thinking about
comparing CFCs to Java (which is an exercise done far too often, IMO) --
they want to know the "best practices" for their every day development
of CFCs.

Once someone knows the best practices and the reasons for them they can
feel free, of course, to break the rules.

Since CFCs (and CFML) don't have constants that's not a very good
example, IMO.



> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Behalf Of Matt Liotta
> Sent: Wednesday, July 30, 2003 1:58 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [CFCDev] "this" scope vs. unnamed
>
>
> There are many perfectly valid reasons for using public fields in an 
> object. For example, many classes in the Java hierarchy use public 
> fields for constants. In fact, I find it quite annoying when class 
> authors require bit-based states without representing those states 
> with constants.
>
> -Matt

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

Reply via email to