> > What would happen, for example, if your program received a 
> > value for Form.myvar, and a different value for URL.myvar? 
> 
> In my apps, the form variable would "win" the spot in the 
> attributes scope. Not a problem.

Is this explicitly noted in the application architecture? If not, it's a
problem, from my perspective. Good design explicitly notes such things,
rather than relying on "default" behaviors, which may either be
misunderstood by others reading your code, or which may lead someone reading
your code to incorrectly infer that a different behavior may occur, or which
don't explicitly describe what you intend to occur.

For example, let's say you have the following expression:

x = 5;
y = 3;
z = 2;
final = x + y * z;

Now, we can both read that, and because we know the order of evaluation,
we'll be able to figure out that our final variable will be equal to 11,
rather than 16, because the multiplication will be performed first. However,
we can't be sure that the original author intended that behavior - we can
only assume that the author knew the order of evaluation. So, from this
perspective, the use of parentheses may improve the readability of the
statement:

final = x + (y * z);

Now, looking at that, we can determine not only what it'll actually do, but
what the author intended it to do. I admit that this is a trivial example,
and am not saying that you should always use parentheses, but that code
which is self-documenting is, all other things being equal, superior to code
which isn't.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

______________________________________________________________________
Get Your Own Dedicated Windows 2000 Server
  PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation · $99/Month · Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to