Click here to Skip to main content
15,888,351 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: try-catch code convention Pin
Kunal Chowdhury «IN»5-Jul-10 23:34
professionalKunal Chowdhury «IN»5-Jul-10 23:34 
GeneralRe: try-catch code convention Pin
fjdiewornncalwe6-Jul-10 4:41
professionalfjdiewornncalwe6-Jul-10 4:41 
GeneralRe: try-catch code convention Pin
Abhinav S6-Jul-10 19:04
Abhinav S6-Jul-10 19:04 
GeneralRe: try-catch code convention Pin
Alois Kraus15-Jul-10 22:22
Alois Kraus15-Jul-10 22:22 
GeneralRe: try-catch code convention Pin
whatrevolution19-Jul-10 4:03
whatrevolution19-Jul-10 4:03 
GeneralRe: try-catch code convention Pin
Hired Mind22-Jul-10 7:19
Hired Mind22-Jul-10 7:19 
GeneralMy turn on MS Bashing PinPopular
peterchen1-Jul-10 0:59
peterchen1-Jul-10 0:59 
GeneralA whole day wasted on one stored procedure Pin
ChrisC(@ncmail)28-Jun-10 12:29
ChrisC(@ncmail)28-Jun-10 12:29 
Half a day to find the sp causing the problem... another half to fix it and send emails out about it.

The first problem is that the original programmer (not here) said that the problem didn't happen.
This was "a while back" and eventually the users found a way prove that the problem does exist.

So I find the offending sp and it is: almost 200 lines long, creats a temp table as it's first action, contains two cursors, and the cursor for each fetch had an "IF NOT EXISTS(...".

Correct me if I'm wrong: using the EXISTS is a big no-no, right? Shouldn't you just do an extra left join (if necessary) and use that field instead of the EXISTS?

In fairness to the original coder, I am not sure how this could have been done without a cursor.
(I know it can... I'm just saying that generally if I stare at something with a cursor I quickly see how to do it without one - but that didn't happen this time)

Seven hours I spent on this today, plus having our contractor in my cube for about half a day, plus the meeting with my boss + her boss, plus what I spent on this last week.

Ironically, the original programmer was "literally correct" the problem (as stated by the user) was not a bug, though the application *was* certainly wrong.

[sigh] Since I'm mostly getting this off my chest I put it in coding horrors instead of the db forum.
GeneralRe: A whole day wasted on one stored procedure Pin
J4amieC28-Jun-10 21:59
J4amieC28-Jun-10 21:59 
GeneralRe: A whole day wasted on one stored procedure Pin
David Skelly28-Jun-10 22:36
David Skelly28-Jun-10 22:36 
GeneralRe: A whole day wasted on one stored procedure Pin
ChrisC(@ncmail)29-Jun-10 8:16
ChrisC(@ncmail)29-Jun-10 8:16 
GeneralRe: A whole day wasted on one stored procedure Pin
PIEBALDconsult9-Jul-10 10:47
mvePIEBALDconsult9-Jul-10 10:47 
GeneralStupid Naming Consequences with LINQ Pin
Member 269131324-Jun-10 22:45
Member 269131324-Jun-10 22:45 
GeneralRe: Stupid Naming Consequences with LINQ Pin
whatrevolution25-Jun-10 2:49
whatrevolution25-Jun-10 2:49 
GeneralRe: Stupid Naming Consequences with LINQ Pin
User 274316225-Jun-10 23:59
User 274316225-Jun-10 23:59 
GeneralMessage Closed Pin
28-Jun-10 8:59
_beauw_28-Jun-10 8:59 
GeneralRe: Stupid Naming Consequences with LINQ Pin
David Skelly28-Jun-10 22:38
David Skelly28-Jun-10 22:38 
GeneralRe: Stupid Naming Consequences with LINQ Pin
whatrevolution3-Jul-10 17:28
whatrevolution3-Jul-10 17:28 
GeneralRe: Stupid Naming Consequences with LINQ Pin
Hired Mind13-Jul-10 10:00
Hired Mind13-Jul-10 10:00 
GeneralRe: Stupid Naming Consequences with LINQ Pin
Marcelo Ricardo de Oliveira8-Jul-10 6:50
Marcelo Ricardo de Oliveira8-Jul-10 6:50 
GeneralJavaScript Conditional Pin
Andres Martin23-Jun-10 12:05
Andres Martin23-Jun-10 12:05 
GeneralRe: JavaScript Conditional Pin
Luc Pattyn23-Jun-10 12:17
sitebuilderLuc Pattyn23-Jun-10 12:17 
GeneralRe: JavaScript Conditional Pin
oggenok6423-Jun-10 20:48
oggenok6423-Jun-10 20:48 
GeneralRe: JavaScript Conditional Pin
Kevin Drzycimski24-Jun-10 0:14
Kevin Drzycimski24-Jun-10 0:14 
GeneralRe: JavaScript Conditional Pin
Viorel.24-Jun-10 3:52
Viorel.24-Jun-10 3:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.