Amen to this--you should scope for the sake of clarity first and foremost. I had to take over maintenance on an application a couple of years ago and the original coder didn't scope anything. Not only was this horrendously annoying, it caused several rather insidious bugs where, for example, a local variable and a form variable with the same name were getting used on the same page. It just isn't good coding practice not to scope your variables. I personally couldn't care less about the small performance gain, but I do care about inheriting someone else's code when they haven't scoped anything. It's just a lot nastier to wade through, and as others have said, I like seeing "form." because then I know exactly where that variable came from.

Matt

----Original Message Follows----
From: S.Isaac Dealey <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: RE: Since its so quiet lately . . .
Date: Fri, 19 Sep 2003 00:44:34 -0500

That being said I don't personaly scope for the sake of
performance. I never have. I scope for the sake of clarity.
That and the fact that certain scopes (attributes) can not
be referenced by an unscoped variable. I find it much easier
to read a new piece of someone else's code when the majority
of the variables are scoped. I find my own code easier to
read as well -- and -- it also eliminates the possibility of
unscoped local variables being accidentally or maliciously
supplanted by hand-mangled url variables.

_________________________________________________________________
Try MSN Messenger 6.0 with integrated webcam functionality! http://www.msnmessenger-download.com/tracking/reach_webcam


-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To unsubscribe: Send UNSUBSCRIBE to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org




Reply via email to