Triggers: why do developers like them so much?

I just had an interesting conversation with a developer about triggers. He's building a new application and wanted to use triggers to keep a "current value" field updated on a master table each time a new log record was created.

I just can't stand triggers. If I were designing the above app, I'd create a utility to write the log record, the utility would update the master table and do the insert into the log together. No tricks, no "2 years from now" trying to figure out why the trigger is there. It's a new app, build it correctly.

Looks like I'm not the only one who hates triggers:
http://tkyte.blogspot.com/2007/03/dreaded-others-then-null-strikes-again.html#comments

He doesn't think there worth it, I don't like them, but developers love them because they have to write less code, mama mia.

So, did I sell the "it's not worth it" to the developer, probably not. I think he just caved in and gave up. Same old problem for me, I need to learn how to sell the sizzle and not the steak.

Until next time...Rich

Comments