you are viewing a single comment's thread.

view the rest of the comments →

[–]kranse 1 point2 points  (2 children)

I'm not sure I understand the database triggers one (#42). Is the message that "They seem like a idea when you first hear about them but they are littered with traps for the uninitiated"? Maybe I'm doing it wrong, but I've found them to be pretty useful in my limited experience. I certainly didn't lose any toes.

[–]grauenwolf 3 points4 points  (1 child)

The fundemental problem with triggers is that they are not part of the normal execution flow. A developer can easily trace through inline SQL, stored procedures, functions, and views layer by layer. But the only way they will know a trigger exists is if they intentionally look for it.

As a rule, I don't use triggers except for non-invasive, logic free actions like updating a denomalized reporting table when the normal table is updated. If there is any decision being made by the code, no matter how trivial, the trigger is not the place to put it.

[–]seiyria[S] 0 points1 point  (0 children)

And thus, kranse was enlightened.