Click here to Skip to main content
11,428,497 members (66,662 online)

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, embarrasing 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: Hello? I guess Pin
loctrice24-Jun-13 11:37
memberloctrice24-Jun-13 11:37 
GeneralRe: Hello? I guess Pin
Rajesh Anuhya25-Jun-13 2:36
professionalRajesh Anuhya25-Jun-13 2:36 
GeneralRe: Hello? I guess Pin
Rob Grainger24-Jun-13 0:50
memberRob Grainger24-Jun-13 0:50 
GeneralRe: Hello? I guess Pin
Joan Murt30-Jun-13 22:03
professionalJoan Murt30-Jun-13 22:03 
GeneralRe: Hello? I guess Pin
ihoecken25-Jun-13 6:12
memberihoecken25-Jun-13 6:12 
GeneralRe: Hello? I guess Pin
vonb25-Jun-13 21:37
professionalvonb25-Jun-13 21:37 
JokeRe: Hello? I guess Pin
Killzone DeathMan28-Jun-13 6:34
groupKillzone DeathMan28-Jun-13 6:34 
GeneralHow not to catch the exception Pin
feeza_n3n20-Jun-13 0:32
memberfeeza_n3n20-Jun-13 0:32 
While looking into some production issues and after much looking into the few functions that span over 700-1000 lines, I stumbled upon the root cause. Oh my what a priceless gem!

private static int somefunction(some params)
  {
      int iKey = -1;
      try
      {
          //codes transaction
      }
      catch (SqlException ex)
      {
          return iKey;
      }
      catch (Exception ex)
      {
          return iKey;
      }
      finally
      {
         //release or closed whatever
      }
 
      return iKey;
  }

GeneralRe: How not to catch the exception Pin
Mohammed Hameed20-Jun-13 1:32
professionalMohammed Hameed20-Jun-13 1:32 
GeneralRe: How not to catch the exception Pin
jim lahey20-Jun-13 2:55
memberjim lahey20-Jun-13 2:55 
GeneralRe: How not to catch the exception Pin
jim lahey20-Jun-13 2:54
memberjim lahey20-Jun-13 2:54 
GeneralRe: How not to catch the exception Pin
GastonV20-Jun-13 4:09
memberGastonV20-Jun-13 4:09 
GeneralRe: How not to catch the exception Pin
Richard Deeming20-Jun-13 4:56
professionalRichard Deeming20-Jun-13 4:56 
GeneralRe: How not to catch the exception Pin
GastonV20-Jun-13 5:30
memberGastonV20-Jun-13 5:30 
GeneralSomething is not as I expected Pin
Mohibur Rashid19-Jun-13 23:40
professionalMohibur Rashid19-Jun-13 23:40 
GeneralRe: Something is not as I expected Pin
Amitosh Swain20-Jun-13 18:53
memberAmitosh Swain20-Jun-13 18:53 
GeneralRe: Something is not as I expected Pin
Mohibur Rashid20-Jun-13 23:25
professionalMohibur Rashid20-Jun-13 23:25 
GeneralRe: Something is not as I expected Pin
Amitosh Swain20-Jun-13 23:32
memberAmitosh Swain20-Jun-13 23:32 
GeneralRe: Something is not as I expected Pin
Rob Grainger24-Jun-13 0:57
memberRob Grainger24-Jun-13 0:57 
GeneralRe: Something is not as I expected Pin
Member 467320212-Jul-13 14:11
memberMember 467320212-Jul-13 14:11 
GeneralEverywhere a single Catch block used catching top Exception all times. Pin
Mohammed Hameed19-Jun-13 21:28
professionalMohammed Hameed19-Jun-13 21:28 
GeneralRe: Everywhere a single Catch block used catching top Exception all times. Pin
cjb11019-Jun-13 22:13
membercjb11019-Jun-13 22:13 
GeneralRe: Everywhere a single Catch block used catching top Exception all times. Pin
Mohammed Hameed19-Jun-13 22:20
professionalMohammed Hameed19-Jun-13 22:20 
GeneralRe: Everywhere a single Catch block used catching top Exception all times. Pin
Rob Grainger24-Jun-13 1:02
memberRob Grainger24-Jun-13 1:02 
GeneralRe: Everywhere a single Catch block used catching top Exception all times. Pin
Jarek Kruza19-Jun-13 22:56
memberJarek Kruza19-Jun-13 22:56 

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

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


Advertise | Privacy | Mobile
Web04 | 2.8.150428.2 | Last Updated 3 May 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid