On Wed, 21 Jul 2004 15:22:31 -0400, Bryan F. Hogan
<[EMAIL PROTECTED]> wrote:
> > 1. <cfset var x> i.e., with 'var' you don't need to actually
> > initialize the variable
> Isn't that the way it is now?

Nope. You'll get "Local variables must be initialized"...

> > 2. the ability to use <cfset var x = ...> anywhere instead of just at
> > the top of the function so you could declare variables at their first
> > use
> This is a preference, I prefer it to be at the top. What do you consider
> the benefits of being able to declare at their first use?

It's known as "locality of reference" although in a language that
doesn't have proper block scopes it isn't as valuable I guess. It
basically puts the declaration as close to the first use as possible
(and in a block scoped language you'd generally arrange for the
variable to go out of scope as soon as you'd finished using it).
-- 
Sean A Corfield -- http://www.corfield.org/blog/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' 
in the message of the email.

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

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to