Bill Rawlinson wrote:
My only caveat with using #NOT Len(x)# inline with cfqueryparam is
that I typically don't like to use negative logic.
It was something that was taught to me by a much senior developer
during a code review during my first internship. Typically using
positive logic is easier to read.
I think the idea of the isNull function is a good one - and Peter
makes a good modification to it in his condensation, even though in
there he is using negative logic. Since it is enclosed in the isNull
wrapper function I actually don't mind it.
Each person/organization has their own style so it is up to you and
your preference; but I think I like the "isNull" function idea as
Peter wrote it. It's short, concise, and hides the cumbersome logic.
Bill
I see exactly what you mean Bill about the negative logic, however I
never test a boolean expression with against a value since the condition
is always true or false.
Good note on it here and read the second comment of the page by Sean
Corfield:
http://livedocs.macromedia.com/wtg/public/coding_standards/goodpractice.html
Thanks for the plug about the function. :-) I don't know if using
negative logic is horribly cumbersome as long as your code isn't laced
with it. I only use it in certain situations and the only one I can
think of at the moment is the... NOT len(someVar) instead of...
len(someVar) EQ 0 or even worse... someVar EQ "".
This has started me thinking that my DAOs should extend a generic DAO
function set like isNull, isNullDate, etc. Any thoughts? (BTW I use a
DAO factory so think in that context and that all data that comes into a
DAO has already been validated and "cleaned" by the bean --> LTO.)
Best,
.Peter
--
Peter J. Farrell :: Maestro Publishing
blog :: http://blog.maestropublishing.com
email :: [EMAIL PROTECTED]
Create boilerplate beans!
Check out the Mach-II Bean Creator - free download.
http://blog.maestropublishing.com/mach-ii_beaner.htm
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to
[email protected] with the words 'unsubscribe cfcdev' as the subject of the
email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
(www.cfxhosting.com).
CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm
An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]