> A lot of folks would argue about the pound signs saying that it's just
> a matter of preference. I certainly don't care to see pound signs
> where they're not needed <cfif #condition#> -- it strikes me as sloppy
> and confusing, but I've never made a real issue of it.
That's why I said look. it's all about perception.

> by 2. are you referring to people using boolean evaluation without the
> "is" or "eq" keywords or people using more conditions than are
> necessary for a given if statement? i.e.
I'm refering to

<CFIF...
    <CFIF....
        statement
    </CFIF>
</CFIF>
Where the 2 CFIF clauses can be combined. This was seen in the
<CFIF IsDefined('var')>
    <CFIF var is X>
type statements. CF 4.01 added the ability to combine them properly where if 
the first clause of an AND statement failed, the second never happened (for 
example)

> My additions:
>
> 1) Improper use of evaluation in general:
>
> good: <cfset myvariable = myothervariable>
> bad: <cfset myvariable = "#myothervariable#">
Goes to proper use of pounds

> good: <cfset myvariable = mystruct[key]>
> bad: <cfset myvariable = evaluate("mystruct.#key#")>
partially proper use of pounds as well as proper usage of evaluate

> 2) Use of arrays where structures are more appropriate
>
> good: mycart[1].productname
> good: mycart[1]["productname"]
> bad: mycart[1][1]             (not-descriptive)
> bad: mycart[1][productname]   (overcomplicated)
>
> (note the lack of quotes in the latter indicating that "productname"
> must also be declared as a local variable in this case with a value of
> "1").
>
> 3) use of snippets or coppy-pasted code -- particularly with MX
> (between <cffunction> and CFC's) if you see more than one line of code
> repeated just about anywhere, there is almost always a way it could be
> encapsulated so that the code wouldn't need to be repeated, thus
> creating unnecessary maintenance / development burdens later. This is
> more obscure, and ymmv with regard to the amount of code that
> constitutes a "snippet". I've been known to agonize over replication
> of code that's even one line in length. But then I'm a big fan of Once
> And Only Once (OAOO) and Don't Repeat Yourself (DRY).
>
> 4) not using cfqueryparam :)


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:11:2536
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/11
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:11
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.11
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to