> In essence, refering to variables outside the scope of a tag
> is analogous to using global variables in other languages, something
> that was frowned upon in the books I read and the courses I took.
> The proper way, then, would be to explicitly pass all necessary
> parameters to a tag, and eliminate the uncertainty.
....and double your workload.
Well, OK... maybe that's a slight exaggeration ;-)
Don't get me wrong... I *firmly* believe in taking more time and doing the
job in the best way you know how.
And very often there seems to be a "right" way to do something and "every
other way". Cut corners and you can find that when you have to extend the
application, all your short-cuts come back and bite you on the a**.
But I built a site ages ago that passed *all* the application variables (I
wasn't using request scope then) to custom tags as attributes. I figured,
hey, it's a tag. It should be independent of the application. It should be
written based on the assumption that it doesn't have access to anything
within the application.
Shit, what a load of work that was... took a lot longer than I'd anticipated
(there was reams of the stuff) and looking back I don't really feel that
appeasing my "developer's conscience" was worth all the extra work.
Sure, you can argue the point about not using global variables and I'm sure
there's something in it (I don't class myself as a programmer and so don't
feel I could speak with any authority on the subject), but application
design surely has to be a compromise.
You can modularise and tagify absolutely everything if you want, but there
always seems to be a point at which the benefits it bring don't outweigh the
extra work it generates.
I don't want to start a holy war - in principle I absolutely agree with you.
But, as developers, we have to draw a line somewhere.
That clock don't stop ticking and there's a life away from the computer...
somewhere... if I can just remember where I put it.
--
Aidan Whitehall <[EMAIL PROTECTED]>
Netshopper UK Ltd
Advanced Web Solutions & Services
http://www.netshopperuk.com/
Telephone +44 (01744) 648650
Fax +44 (01744) 648651
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists