• icelava (unregistered)

    Maybe it's this whole Globalization thing - the installer of the stored procedure will determine the native language of the user and add comments in that language :)

  • MrGenericComment (unregistered)

    Now if that isn't a generic comment, I don't know what is!

  • DCD (unregistered)

    It reminds me of folks who use xml tags when they type like: <sarcasm>as if!</sarcasm> If it needs a xml tag to denote sarcasm then it isn't sarcasm. < wink />

  • Hmm (unregistered)

    //Write inane comment
    I don't see anything wrong with this code!

  • awl (unregistered)

    Sometimes when I am about to write a function, I outline everything in pseudocode in the comments. Then I go back and put some real code under each comment. Maybe that's what he did and didn't feel like removing the comment shrugs

  • skicow (unregistered)

    You would think that if he was going to verbosely comment his code like that then he would at least comment what the variables are!

  • Derick Bailey (unregistered)

    OOO! LOOK! there's finally a WTF that's NOT VB code. :P

  • Barry Etter (unregistered)

    At least make the comment descriptive...like "begin THE transaction". I mean, if it's just "begin transaction", maybe there are a number of different transactions and this one is named, "begin".

    Then, he would have "begin transaction", "move transaction", "do_something_else transaction", etc.

  • josh (unregistered)

    not funny... granted its a stupid comment, but I don't think it is really wtf material... Its about as funny as a spelling mistake... Can someone start a new website for making fun of other peoples grammer? That way we can get back to making fun of bad programmers here... Thanks!

    Snoochi Boochies! Neudge!

  • whatever (unregistered)

    josh: a lon and wee dontt mak funn off thay're spallang? Peeepals pongtoashon az fonyy tu!!!1!

  • Chris R. Timmons (unregistered)

    The superfluous transaction comment is probably the best thing about this code fragment.

    From a maintenance standpoint, it's going to be expensive and frustrating. The variable naming convention is both inconsistent and obscure. The word "number" is abbreviated in two different ways: BachNum and SequenceNo. BTW, just what is a "Bach"? The code is full of "magic" constants, like 16384, 101 and "ERS", which the programmer definitely should have commented on. The code to count the number of rows in the temporary @payables_trx_temp table is duplicated.

    Finally, the only other comment in the code is also wrong. The "set" commands are performing variable definitions, not declarations.

    It's code like this that demonstrates the value of formal code reviews. Code that is potentially expensive to maintain can be corrected so the maintenance cost is not incurred.

  • Mark (unregistered)

    If I had to guess, I bet he commented out the "begin transaction" at some point during debugging and somehow typed it in again instead of un-commenting it. Maybe it was scrolled up out of view?

  • Jeff (unregistered)

    What is a BachNum? The number of Johann Sebastians in the database? Why abbreviate and only remove one letter? At least have fun with it and remove the 'a' and leave the 't'. BtchNum is more fun to read out loud.

  • Jeff (unregistered)

    BTW, the site has its own WTF? in the title of this one. Transaction is misspelled.

  • Alex Papadimoulis (unregistered)

    :-( I'm posting from work, where they disallow browser plug-ins like ieSpell are not permitted.

  • foxyshadis (unregistered)

    I think you should run a virus scan, though. You might have a copy of win32.ieEngrish on there.... ^_~

  • Ray S (unregistered)

    --This is a comment where I say that comments like this are a complete waste of time and do more harm than good.
    COmments like this are a complete waste of time, and do more harm than good.

    --The above was a comment.

  • Fubar (unregistered)

    I often end scripts that should NOT be run without think with the following:
    <pre>
    rollback
    --commit transaction
    </pre>

    Sometimes comments are used for purposes other than documentation. This one just looks like a typo, as such it ain't that funny.

  • Miles Archer (unregistered)

    A trans-cation is different than a cis-cation. Don't you know anything about chemistry?

  • Foobarer (unregistered)

    I think the commenting has already been taken care of, so I'll just get to my question: what program is that code viewed in? Syntax highlighting goooood...

  • Jason Hasner (unregistered)

    Miles: Since it's T-SQL, I'd say that program is probably Query Analyzer.

  • Dude (unregistered)

    WiTango Sucks... does does Tango.

  • Foobarer (unregistered)

    Thanks, Jason.

  • Silent Bob (unregistered)

    It looks to me like this was a clever bug fix. Originally there was a problem where it used to begin the transaction twice. Fortunately a later reviewer spotted this problem and commented out the first "begin transaction" - after much agonising internal discourse about which two he should comment out.
    Commenting it out rather than deleting it is very important as it ensures that the poor source control system won't get confused about which of the two lines has been deleted.

Leave a comment on “What does "begin transcation" do?”

Log In or post as a guest

Replying to comment #23747:

« Return to Article