Thanks for the comments. I will update the wiki with it
http://wiki.mindkeeper.net/index.php?title=ColdFusion_Coding_Standards 

-----Original Message-----
From: Dominic Watson [mailto:[EMAIL PROTECTED] 
Sent: Saturday, October 06, 2007 11:28 AM
To: CF-Talk
Subject: Re: CF Code readability (Where Clause)

I always go for either:

WHERE x = 1
AND y = 2

or:

WHERE x = 1 AND y = 2

Usually the first but never either of the options you gave (that's just me).

Dom


On 06/10/2007, Zaphod Beeblebrox <[EMAIL PROTECTED]> wrote:
>
> yep, I pretty much do the same thing, also my selects look like this:
>
> SELECT   col1
>                  ,col2
>                  ,col3
> FROM      table1
>      INNER JOIN table2 ON table1.col1 = table2.col2 WHERE  x = 1
>     AND   Deleted = 0
>
> In essence, I capitalize my sql keywords, I place the commas in from 
> of field names (for the same reason as the AND placement), alias any 
> table over 4 characters, and I keep all my indentation equal.  I 
> despise the MS Enterprise Manager because invariably some coworker 
> will submit a query to me that's a clump of unformatted text.
>
> On 10/6/07, ColdFusion <[EMAIL PROTECTED]> wrote:
> > How many use the query coding (where clause) as:
> >
> > where
> >             x = 1 and
> >             Deleted = 0
> >
> >
> > OR
> >
> >
> > where
> >         x = 1
> >         and Deleted = 0
> >
> >
> >
> > I prefer the second one as if I need to remove or simply comment the
> line
> > out for testing, I only do the one line rather than having the 
> > comment
> tags
> > skew over multiple lines?
> >
> > Thanks for your input.
> >
> >
> >
> >
> >
>
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Download the latest ColdFusion 8 utilities including Report Builder,
plug-ins for Eclipse and Dreamweaver updates.
http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:290450
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to