Click here to Skip to main content
15,909,518 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.

 
GeneralI want that money Pin
NikoTanghe6-Nov-08 8:05
NikoTanghe6-Nov-08 8:05 
GeneralRe: My boss must be a klingon Pin
Andrew Rissing6-Nov-08 8:55
Andrew Rissing6-Nov-08 8:55 
GeneralRe: My boss must be a klingon Pin
Rob Graham6-Nov-08 10:05
Rob Graham6-Nov-08 10:05 
GeneralRe: My boss must be a klingon Pin
CPallini6-Nov-08 10:42
mveCPallini6-Nov-08 10:42 
GeneralRe: My boss must be a klingon Pin
cpkilekofp7-Nov-08 5:40
cpkilekofp7-Nov-08 5:40 
GeneralRe: someone who does not trust arithmetic Pin
cpkilekofp7-Nov-08 5:35
cpkilekofp7-Nov-08 5:35 
GeneralRe: someone who does not trust arithmetic Pin
thema3x19-May-10 13:54
thema3x19-May-10 13:54 
GeneralTry Catch Pin
cyber-drugs3-Nov-08 22:59
cyber-drugs3-Nov-08 22:59 
I was cleaning up some old mailing system code developed by some contractors at my work about 3 years before I even joined the company. It was designed in .NET 1.1, but it worked, so we never really upgraded it... I'll be re-writing the whole thing from scratch now that I've seen what it looks like (after we encountered our first issue).

Tell me if you can see the problem with this (pseudo code, as I cannot release the actual code for public display)...

try
{
  /*
    -- Insert 200 lines of:
       Class declarations,
       Internal function calls,
       External function calls,
       Database function calls,
       String Concatination of variables without checking/handling types (insert the wrong type and it will fall over),
       Send an email
  */
}
catch (Exception ec)
{
  /*
    -- Send email to bugs@ourcompany.com...
       email address does not exist as far as any of the current dev team are aware,
       there is no exception handling on the sending of the email, so if there mail server is down, it doesn't give you much insight
  */
}


As a temp measure to view the outcome, I changed the bugs email address to my own email address, to find that when the email sent, the error merely pointed at the catch{} lines of code, without giving any indication at all as to where inside the 200 lines of code the error was occuring!
GeneralRe: Try Catch Pin
CPallini3-Nov-08 23:10
mveCPallini3-Nov-08 23:10 
GeneralRe: Try Catch Pin
BillW334-Nov-08 4:24
professionalBillW334-Nov-08 4:24 
GeneralRe: Try Catch Pin
QuiJohn4-Nov-08 6:45
QuiJohn4-Nov-08 6:45 
GeneralRe: Try Catch Pin
cyber-drugs4-Nov-08 23:07
cyber-drugs4-Nov-08 23:07 
GeneralRe: Try Catch Pin
cpkilekofp7-Nov-08 5:44
cpkilekofp7-Nov-08 5:44 
GeneralRe: Try Catch Pin
Kevin McFarlane5-Nov-08 23:42
Kevin McFarlane5-Nov-08 23:42 
GeneralRe: Try Catch Pin
supercat96-Nov-08 6:07
supercat96-Nov-08 6:07 
GeneralRe: Try Catch Pin
DrWheetos7-Nov-08 22:04
DrWheetos7-Nov-08 22:04 
GeneralRe: Try Catch Pin
supercat98-Nov-08 10:05
supercat98-Nov-08 10:05 
GeneralA big if Pin
ClementsDan1-Nov-08 18:42
ClementsDan1-Nov-08 18:42 
GeneralRe: A big if Pin
PIEBALDconsult2-Nov-08 3:04
mvePIEBALDconsult2-Nov-08 3:04 
AnswerRe: C/C++ or C#? [modified] Pin
Thomas Weller2-Nov-08 20:13
Thomas Weller2-Nov-08 20:13 
GeneralRe: C/C++ or C#? Pin
Nagy Vilmos2-Nov-08 22:28
professionalNagy Vilmos2-Nov-08 22:28 
GeneralRe: C/C++ or C#? Pin
PIEBALDconsult3-Nov-08 4:03
mvePIEBALDconsult3-Nov-08 4:03 
GeneralRe: C/C++ or C#? Pin
Nemanja Trifunovic3-Nov-08 8:24
Nemanja Trifunovic3-Nov-08 8:24 
GeneralRe: C/C++ or C#? Pin
Thomas Weller3-Nov-08 8:48
Thomas Weller3-Nov-08 8:48 
GeneralRe: C/C++ or C#? Pin
Nemanja Trifunovic3-Nov-08 9:11
Nemanja Trifunovic3-Nov-08 9:11 

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.