- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
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 :)
Admin
Now if that isn't a generic comment, I don't know what is!
Admin
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 />
Admin
//Write inane comment
I don't see anything wrong with this code!
Admin
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
Admin
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!
Admin
OOO! LOOK! there's finally a WTF that's NOT VB code. :P
Admin
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.
Admin
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!
Admin
josh: a lon and wee dontt mak funn off thay're spallang? Peeepals pongtoashon az fonyy tu!!!1!
Admin
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.
Admin
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?
Admin
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.
Admin
BTW, the site has its own WTF? in the title of this one. Transaction is misspelled.
Admin
:-( I'm posting from work, where they disallow browser plug-ins like ieSpell are not permitted.
Admin
I think you should run a virus scan, though. You might have a copy of win32.ieEngrish on there.... ^_~
Admin
--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.
Admin
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.
Admin
A trans-cation is different than a cis-cation. Don't you know anything about chemistry?
Admin
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...
Admin
Miles: Since it's T-SQL, I'd say that program is probably Query Analyzer.
Admin
WiTango Sucks... does does Tango.
Admin
Thanks, Jason.
Admin
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.