>> I'm not sure I follow what you're saying there. >> >> Are you saying it's bad to create a query without the full >list of columns >> or something else? > >I meant that if you are not expecting an empty query object you should >explicitly set the columns within the queryNew(). It would be >bad not to. > >I know your talking about the same thing and you feel that is more >overhead than you would like.
Yep, I find that cumbersome to maintain and don't find that it gives me much benefit, but that's just me. > >>>Hence the nice addition of the var scoped variables at the >top of the >>>function. >> >> >> Not sure I understand what you're getting at here either. > >We may not be thinking the same thing. If you needed to change from an >array to a structure you would just change the var from <cfset var >myVar=arrayNew(1) to <cfset var myVar=structNew()> Yep, That's how I do it right now, but I have reservations that it may lead to confusion in code as it becomes more mature. It would be very easy for a maintenance developer to re-initialize the value from a struct to an array somewhere in the middle of the function. That would leave the <cfset var foo = structNew()> sitting there waiting to confuse the next maintenance programmer who comes along. > >> That means that I will take great care to do things now that >will avoid more >> work down the line. That's what an awful lot of people seem >to do. I was >> being flippant when I described it as laziness. I should >probably have >> described in terms of minimizing the total cost of a project >or some such. > >I though you meant Lazy as in I'm not going to plan for the future. We >both agree on avoiding work down the line. However in many cases when >you can just glance at the var variables and know their types without >having to track it down that indeed saves work down the road. I'm not so sure that you can just glance at the top of a function and know that the variables are going to be the type they are declared as. CFML being the typeless language that it is, there is nothing to stop someone from changing the type of a variable as necessary. I tend to try to avoid doing things that could mislead people (especially myself) in the future, so I use minimal commenting and very rarely use the metadata attributes (displayname, hint) of any of the CFC tags. That is another reason for initializing variables the way I do. That could be down to me having worked with too much labarynthine code in the past where it has gone through the hands of numerous developers en route to me. In those cases I find that the majority of the comments are outright lying about what is going on. The same goes for the majority of the hints. It is also pretty common for variables to become redundant or change their type in unexpected ways. Spike ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com). An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]
