Click here to Skip to main content
15,891,874 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: When an error just doesn't give you enough information Pin
Lutosław14-Jul-11 23:27
Lutosław14-Jul-11 23:27 
GeneralRe: When an error just doesn't give you enough information Pin
BillW3315-Jul-11 5:11
professionalBillW3315-Jul-11 5:11 
GeneralRe: When an error just doesn't give you enough information Pin
RobCroll15-Jul-11 8:27
RobCroll15-Jul-11 8:27 
GeneralRe: When an error just doesn't give you enough information Pin
OriginalGriff15-Jul-11 8:33
mveOriginalGriff15-Jul-11 8:33 
GeneralRe: When an error just doesn't give you enough information Pin
Schmuli16-Jul-11 20:52
Schmuli16-Jul-11 20:52 
GeneralRe: When an error just doesn't give you enough information Pin
YSLGuru25-Jul-11 6:22
YSLGuru25-Jul-11 6:22 
GeneralRe: When an error just doesn't give you enough information Pin
OriginalGriff25-Jul-11 8:30
mveOriginalGriff25-Jul-11 8:30 
GeneralEverything That Has a Beginning Has an End (Eventually) PinPopular
AspDotNetDev12-Jul-11 7:18
protectorAspDotNetDev12-Jul-11 7:18 
I just installed Linqer to convert some SQL to LINQ. Unfortunately, it bombed out on me, but not before automatically generating this code:
VB.NET
'''<Summary>
'''The method returns the view for the index given.
'''</Summary>
Protected Overrides Function GetViewAt(ByVal index As Integer) As System.Collections.Generic.KeyValuePair(Of String, String)
	If (index = 0) Then
		Return GetView0
	End If
	If (index = 1) Then
		Return GetView1
	End If
	If (index = 2) Then
		Return GetView2
	End If
	If (index = 3) Then
		Return GetView3
	End If
	If (index = 4) Then
		Return GetView4
	End If
	If (index = 5) Then
		Return GetView5
	End If
	' ...lots and lots of lines...
	If (index = 1461) Then
		Return GetView1461
	End If
	If (index = 1462) Then
		Return GetView1462
	End If
	If (index = 1463) Then
		Return GetView1463
	End If
	Throw New System.IndexOutOfRangeException()
End Function


This is about as bad as my 558 lines of QuickBasic glory. Cry | :((

This is probably one of those instances where 3 lines of reflection code is better than 5,000 lines of auto-generated code.
Driven to the ARMs by x86.

GeneralRe: Everything That Has a Beginning Has an End (Eventually) Pin
BobJanova12-Jul-11 22:54
BobJanova12-Jul-11 22:54 
GeneralRe: Everything That Has a Beginning Has an End (Eventually) PinPopular
OriginalGriff12-Jul-11 23:36
mveOriginalGriff12-Jul-11 23:36 
GeneralRe: Everything That Has a Beginning Has an End (Eventually) Pin
Jonathan C Dickinson14-Jul-11 6:09
Jonathan C Dickinson14-Jul-11 6:09 
GeneralRe: Everything That Has a Beginning Has an End (Eventually) Pin
JonasSSH13-Jul-11 2:50
JonasSSH13-Jul-11 2:50 
AnswerRe: Everything That Has a Beginning Has an End (Eventually) Pin
AspDotNetDev13-Jul-11 7:44
protectorAspDotNetDev13-Jul-11 7:44 
GeneralRe: Everything That Has a Beginning Has an End (Eventually) PinPopular
StM0n13-Jul-11 7:21
StM0n13-Jul-11 7:21 
GeneralRe: Everything That Has a Beginning Has an End (Eventually) Pin
MehGerbil14-Jul-11 2:37
MehGerbil14-Jul-11 2:37 
GeneralRe: Everything That Has a Beginning Has an End (Eventually) Pin
BobJanova14-Jul-11 3:48
BobJanova14-Jul-11 3:48 
GeneralRe: Everything That Has a Beginning Has an End (Eventually) Pin
MehGerbil14-Jul-11 4:54
MehGerbil14-Jul-11 4:54 
GeneralRe: Everything That Has a Beginning Has an End (Eventually) Pin
BobJanova14-Jul-11 5:16
BobJanova14-Jul-11 5:16 
GeneralRe: Everything That Has a Beginning Has an End (Eventually) Pin
MehGerbil14-Jul-11 8:40
MehGerbil14-Jul-11 8:40 
GeneralRe: Everything That Has a Beginning Has an End (Eventually) Pin
Fabio Franco14-Jul-11 3:59
professionalFabio Franco14-Jul-11 3:59 
GeneralRe: Everything That Has a Beginning Has an End (Eventually) Pin
cpkilekofp14-Jul-11 8:38
cpkilekofp14-Jul-11 8:38 
GeneralRe: Everything That Has a Beginning Has an End (Eventually) Pin
AspDotNetDev14-Jul-11 8:55
protectorAspDotNetDev14-Jul-11 8:55 
GeneralRe: Everything That Has a Beginning Has an End (Eventually) Pin
cpkilekofp14-Jul-11 10:30
cpkilekofp14-Jul-11 10:30 
GeneralRe: Everything That Has a Beginning Has an End (Eventually) Pin
AspDotNetDev14-Jul-11 10:49
protectorAspDotNetDev14-Jul-11 10:49 
GeneralRe: Everything That Has a Beginning Has an End (Eventually) Pin
cpkilekofp14-Jul-11 11:11
cpkilekofp14-Jul-11 11: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.