Well, he's completely right, of course.  Personally, I really like to have the 
control over my SQL statements, just like I do over my other code, so I write 
them out.  Allows me to test for NULLs (empty integer fields, for example) or 
to build computed fields or wrap sequences of queries in cftransaction or 
whatever.  But, that being said, it seems like cfinsert / cfupdate have gotten 
better since the bad old days where they were truly scary.  I don't use the 
tags personally and I don't plan to, but your friend's arguments seem sound.

- Jason
"Smokey the Bear’s rules for fire safety also apply to government: Keep it 
small, keep it in a confined area, and keep an eye on it."


----------------------------------------

From: "Rick Root" <rick.r...@gmail.com>
Sent: Thursday, September 23, 2010 11:09 AM
To: "cf-talk" <cf-talk@houseoffusion.com>
Subject: cfinsert/cfupdate

I've been trying to convince one of my friends that using cfinsert and
cfupdate is a bad idea.

I recently told him that real CF programmers don't use cfinsert and
cfupdate :)  He responded with this:

CF8 uses cfqueryparam inside all cfinsert/cfupdate statements, making
it just as safe as a regular cfquery, but minus all the clunky code
needed to create the query.  Actually, scratch that, both queries,
since without them you have to maintain both the insert and update
statements separately if you add a new form field to a form.  cfinsert
can do in one line of code what otherwise could be hundreds, not to
mention saving you all the ridiculous potential errors from not having
commas in the correct place, accidentally using or not using quotes,
or mis-matching insert values since the syntax of inserts is different
from updates and the two lines you need to add can often be quite far
apart.  Call me proud to not be a real cf programmer.

I just don't know how to respond to this.

Rick



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337384
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to