Click here to Skip to main content
15,914,014 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: Avoid return statement in the middle - horror or not? Pin
Marcello Faga11-Dec-08 1:30
Marcello Faga11-Dec-08 1:30 
GeneralRe: Avoid return statement in the middle - horror or not? Pin
riced11-Dec-08 14:04
riced11-Dec-08 14:04 
GeneralRe: Avoid return statement in the middle - horror or not? Pin
Thomas Weller11-Dec-08 19:49
Thomas Weller11-Dec-08 19:49 
GeneralRe: Avoid return statement in the middle - horror or not? Pin
PIEBALDconsult12-Dec-08 3:34
mvePIEBALDconsult12-Dec-08 3:34 
GeneralRe: Avoid return statement in the middle - horror or not? Pin
Rob Grainger16-Dec-08 3:10
Rob Grainger16-Dec-08 3:10 
GeneralRe: Avoid return statement in the middle - horror or not? Pin
coolM18-Dec-08 8:04
coolM18-Dec-08 8:04 
GeneralRe: Avoid return statement in the middle - horror or not? Pin
PIEBALDconsult18-Dec-08 8:41
mvePIEBALDconsult18-Dec-08 8:41 
GeneralRe: Avoid return statement in the middle - horror or not? Pin
coolM18-Dec-08 10:57
coolM18-Dec-08 10:57 
JokeRe: Avoid return statement in the middle - horror or not? Pin
notmasteryet18-Dec-08 12:29
notmasteryet18-Dec-08 12:29 
GeneralRe: Avoid return statement in the middle - horror or not? Pin
PIEBALDconsult18-Dec-08 15:47
mvePIEBALDconsult18-Dec-08 15:47 
GeneralRe: Avoid return statement in the middle - horror or not? Pin
Megidolaon22-Feb-09 23:43
Megidolaon22-Feb-09 23:43 
GeneralC and Machine Code horror Pin
Timothy Baldwin2-Dec-08 11:12
Timothy Baldwin2-Dec-08 11:12 
GeneralRe: C and Machine Code horror Pin
Paul Conrad2-Dec-08 11:16
professionalPaul Conrad2-Dec-08 11:16 
GeneralRe: C and Machine Code horror Pin
PIEBALDconsult2-Dec-08 13:39
mvePIEBALDconsult2-Dec-08 13:39 
GeneralRe: C and Machine Code horror Pin
supercat95-Dec-08 6:19
supercat95-Dec-08 6:19 
GeneralRe: C and Machine Code horror Pin
Timothy Baldwin8-Dec-08 8:30
Timothy Baldwin8-Dec-08 8:30 
GeneralRe: C and Machine Code horror Pin
supercat98-Dec-08 19:30
supercat98-Dec-08 19:30 
GeneralRe: C and Machine Code horror Pin
Lutosław5-Dec-08 12:11
Lutosław5-Dec-08 12:11 
GeneralC# bool datatype horror [modified] Pin
Shyam Bharath24-Nov-08 5:00
Shyam Bharath24-Nov-08 5:00 
Here is a code i came across in my own project. Apparently I coded this when I was learning C# few years back. It gave me a good laugh now

bool isActive;
if (chkExamActive.Checked == false)
    isActive = false;
else
    isActive = true;


EDIT

OK I was just going through this old project of mine so here is another one in the same .cs file

ArrayList correctAnswers = new ArrayList();
correctAnswers.Add(txtPhrase.Text);

QuestionTableAdapter questionAdapter = new QuestionTableAdapter();
long QuestionID = questionAdapter.GetData()[0].QuestionID;        
CorrectAnswerTableAdapter correctAnswerAdapter = new CorrectAnswerTableAdapter();
foreach (string correctAnswer in correctAnswers)
       correctAnswerAdapter.Insert(correctAnswer, QuestionID);


Find the horror above Roll eyes | :rolleyes:

-------------------------------------------
It's code that drives you - Shyam

modified on Monday, November 24, 2008 11:26 AM

GeneralRe: C# bool datatype horror Pin
PIEBALDconsult24-Nov-08 5:23
mvePIEBALDconsult24-Nov-08 5:23 
GeneralRe: C# bool datatype horror Pin
Shyam Bharath24-Nov-08 5:32
Shyam Bharath24-Nov-08 5:32 
GeneralRe: C# bool datatype horror Pin
Jason Lepack (LeppyR64)24-Nov-08 5:32
Jason Lepack (LeppyR64)24-Nov-08 5:32 
GeneralRe: C# bool datatype horror Pin
Shyam Bharath24-Nov-08 5:37
Shyam Bharath24-Nov-08 5:37 
GeneralRe: C# bool datatype horror Pin
Lutosław25-Nov-08 10:02
Lutosław25-Nov-08 10:02 
GeneralRe: C# bool datatype horror Pin
Shyam Bharath26-Nov-08 0:07
Shyam Bharath26-Nov-08 0:07 

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.