Then I'll stick to my original statement that there is nothing wrong with
isDefined it's better than embedded structKeyExists.

 

Regards

Dale Fraser

 

 <http://dalefraser.blogspot.com> http://dalefraser.blogspot.com

 

From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of grant
Sent: Tuesday, 5 June 2007 11:02 AM
To: cfaussie@googlegroups.com
Subject: [cfaussie] Re: isDefined() bad?

 

@Dale: It throws.
@Haikal: Good Point. It's that laziness again - setting up and maintaining
defaults can be rather tiresome.

On 05/06/07, Haikal Saadh <[EMAIL PROTECTED]> wrote:


Personally, I favour sane defaults rather than having to check for
presence of variables all the time. And the bigger and more complicated
your data structs get, I think having to check to see if a variable
exists is a quick path to insanity. 

Side effect of eating too much spaghetti...

grant wrote:
> Wow thanks for the response people. My question is really out of pure
> laziness - I have a huge struct that i need to check a key for - the 
> actual key path is
> session.currentuser.currentreport.filters.currentfilter.filterset ,
> where filters, currentfilter and filterset may not be present. so it's
> heaps easier to do a
> isDefined("
session.currentuser.currentreport.filters.currentfilter.filterset")
> than structKeyExists(session.currentuser.currentreport , "filters")
> and structKeyExists(session.currentuser.currentreport.filters ,
> "currentfilter") and so on.
>
> or am i missing something?
>
> On 05/06/07, * Haikal Saadh* <[EMAIL PROTECTED]
> <mailto: [EMAIL PROTECTED]>> wrote:
>
>
>     Having seen more than my fair share of request scope abuse, I can see
>     why he would.
>
>     I think easy access to request in CF can cause poor code. But then 
>     again, guns don't kill people,  people kill people, right?
>
>     Peter Tilbrook wrote:
>     > I agree (disciplined) but he then bagged the "request" scope so
>     now I 
>     > am not so sure.
>     >
>     >
>
>
>
>     >







--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to