It's a tough one, I like to keep things grouped, but also to not declare variables if they're not needed.
I'd probably not declare them if they're not used, so : <cfset var hashPassResults = application.users.hashPass( password=arguments.password, userSalt=getPassInfo.userSalt)> On Monday, June 30, 2014 12:06:54 PM UTC-5, Jason Allen wrote: > > Hey Guys, > > I got another question. > > In some of my more complex cffunction declarations, there's some functions > that I run only if certain requirements or met. So there might be 6 > different function calls, but maybe only 1 or 2 will be used depending on > the arguments passed. > > For instance, as part of a larger 'login' cffunction declaration, I have > the following function call. Thing is, it's part of the code that's most > likely going to be rarely used. > > <cfset var hashPassResults = > application.users.hashPass(password=arguments.password, > userSalt=getPassInfo.userSalt)> > > My question is; should I declare this at the beginning of the function, > then use the 2nd line when it's actually used. Or is it ok to declare the > call the function and declare it as var in one statement? This would avoid > declaring a variable that's rarely used until it's actually needed. > > Start of function: > > <cfset var hashPassResults = structNew()> > > then when actually used... > > <cfset hashPassResults = > application.users.hashPass(password=arguments.password, > userSalt=getPassInfo.userSalt)> > > or do it all when used and don't declare it if not needed > > <cfset var hashPassResults = > application.users.hashPass(password=arguments.password, > userSalt=getPassInfo.userSalt)> > -- -- online documentation: http://openbd.org/manual/ http://groups.google.com/group/openbd?hl=en --- You received this message because you are subscribed to the Google Groups "Open BlueDragon" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
