Code review rant...

  • During an online code review:

    Me: Your trigger is not set based. It will only process a single row.

    SQL Dev (w/ 6 years exp): OK. I have created a cursor inside the trigger that will now process every row.

    Me being very diplomatic: No, no, no... don't use a cursor inside a trigger

    And I wonder why I am losing my hair.

    I had to tell someone.

    j.a.c.

  • j.a.c (5/27/2013)


    During an online code review:

    Me: Your trigger is not set based. It will only process a single row.

    SQL Dev (w/ 6 years exp): OK. I have created a cursor inside the trigger that will now process every row.

    Me being very diplomatic: No, no, no... don't use a cursor inside a trigger

    And I wonder why I am losing my hair.

    I had to tell someone.

    j.a.c.

    Understood and appreciated. I use code reviews not only as code reviews but as private mentoring sessions. It takes a bit of extra time especially at first but teaching folks along the way has a huge snowball effect because people's pride makes them want to teach what they've learned to show how smart they are. It's a 4 way win... you'll win because such ignorance will slowly but surely go away. The recipient wins because they will have learned something new. The people they work with may learn something from that person which serves to magnify your mentoring. And, the company wins because it won't take so many interations in the future to get good solid code.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • I like that term: Private mentoring session. Kind of like Chuck Norris' motivational seminar?

    Ah well not quite. But it is still frustrating to have to point out shortcomings in our highly paid contractor's T-SQL code.

    j.a.c

  • j.a.c (5/28/2013)


    I like that term: Private mentoring session. Kind of like Chuck Norris' motivational seminar?

    Ah well not quite. But it is still frustrating to have to point out shortcomings in our highly paid contractor's T-SQL code.

    j.a.c

    I can understand your frustration. But, its still better to teach him a few things which he is unaware of and expect him to learn. This will eventually help you.

    I can also relate to Jeff's private mentoring sessions. Teaching something to somebody without expecting something in return is a special feeling.

    May be as Jeff mentioned, there is some pride attached to it 🙂


    Kingston Dhasian

    How to post data/code on a forum to get the best help - Jeff Moden
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply