I'm not sure it actually makes much difference. I've had
issues in the past with getUserId() returning 0, which
works for len (it returns 1!) but doesn't work as a
boolean, so I tend to use that format just to be safe.

I'm not sure if Reactor defaults an empty user to "" or 0
because I haven't actually played with it specifically to
find out. It may have been ARF! that defaulted to a 0... or
maybe it was something I did! LOL! It was a while ago that
I ran into the issue and just don't remember all the
details.

It's just that since CF uses short-circuit evaluation, it
can't hurt... it may be one minor extra step but the
nanoseconds involved hardly seem to me to be too expensive.
;)

J

On Thu, 10 Aug 2006 13:29:45 -0500
 "Doug Sims" <[EMAIL PROTECTED]> wrote:
> Just curious and wanted feedback/drawbacks from the group
> on this approach:
> <cfif User.getUserId()>
> rather than this:
> <cfif len(User.getUserId()) and User.getUserId()>
> 
> 
> 
> Thanks,
> Doug S.
> www.evenamonkey.com


-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Reply via email to