Click here to Skip to main content
15,878,814 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: call the same object Pin
TorstenH.20-Apr-11 21:34
TorstenH.20-Apr-11 21:34 
GeneralRe: call the same object Pin
StM0n20-Apr-11 21:38
StM0n20-Apr-11 21:38 
GeneralHmmm... I think something went wrong on line 71, but I'm not sure... Pin
PIEBALDconsult12-Apr-11 19:09
mvePIEBALDconsult12-Apr-11 19:09 
GeneralRe: Hmmm... I think something went wrong on line 71, but I'm not sure... PinPopular
AspDotNetDev13-Apr-11 3:45
protectorAspDotNetDev13-Apr-11 3:45 
GeneralRe: Hmmm... I think something went wrong on line 71, but I'm not sure... PinPopular
gavindon13-Apr-11 4:16
gavindon13-Apr-11 4:16 
JokeRe: Hmmm... I think something went wrong on line 71, but I'm not sure... Pin
Sander Rossel15-Apr-11 3:56
professionalSander Rossel15-Apr-11 3:56 
GeneralRe: Hmmm... I think something went wrong on line 71, but I'm not sure... Pin
Bernhard Hiller19-Apr-11 2:03
Bernhard Hiller19-Apr-11 2:03 
GeneralAustin Danger Powers PinPopular
AspDotNetDev11-Apr-11 13:29
protectorAspDotNetDev11-Apr-11 13:29 
VB.NET
Private Function GetFullName(firstName As String, middleName As String, lastName As String) As String

	' Variables.
	Dim fullName As String
	Dim firstEmpty As String = String.IsNullOrEmpty(firstName)
	Dim middleEmpty As String = String.IsNullOrEmpty(middleName)
	Dim lastEmpty As String = String.IsNullOrEmpty(lastName)


	' Combine name parts into full name.
	If firstEmpty Then
		If middleEmpty Then
			' Powers.
			fullName = lastName
		Else
			If lastEmpty Then
				' Danger.
				fullName = middleName
			Else
				' Powers (ignore middle name).
				fullName = lastName
			End If
		End If
	Else
		If lastEmpty Then
			' Austin (ignore middle name).
			fullName = firstName
		Else
			If middleEmpty Then
				' Austin Powers.
				fullName = String.Format("{0} {1}", firstName, lastName)
			Else
				' Austin Danger Powers.
				fullName = String.Format("{0} {1} {2}", firstName, middleName, lastName)
			End If
		End If
	End If


	' Return full name.
	Return fullName

End Function


I wasn't sure if I should put this in "Clever Code" or "Hall of Shame". Smile | :)
This is not the age of reason, this is the age of flummery, and the day of the devious approach. Reason’s gone into the backrooms where it works to devise means by which people can be induced to emote in the desired direction.

GeneralRe: Austin Danger Powers Pin
Luc Pattyn11-Apr-11 14:13
sitebuilderLuc Pattyn11-Apr-11 14:13 
GeneralRe: Austin Danger Powers Pin
AspDotNetDev11-Apr-11 14:30
protectorAspDotNetDev11-Apr-11 14:30 
GeneralRe: Austin Danger Powers Pin
Luc Pattyn11-Apr-11 14:58
sitebuilderLuc Pattyn11-Apr-11 14:58 
GeneralRe: Austin Danger Powers Pin
AspDotNetDev11-Apr-11 15:13
protectorAspDotNetDev11-Apr-11 15:13 
GeneralRe: Austin Danger Powers Pin
StM0n11-Apr-11 18:45
StM0n11-Apr-11 18:45 
GeneralRe: Austin Danger Powers Pin
Bernhard Hiller11-Apr-11 21:29
Bernhard Hiller11-Apr-11 21:29 
GeneralRe: Austin Danger Powers Pin
AspDotNetDev12-Apr-11 10:06
protectorAspDotNetDev12-Apr-11 10:06 
GeneralRe: Austin Danger Powers Pin
CHLane13-Apr-11 4:37
CHLane13-Apr-11 4:37 
GeneralRe: Austin Danger Powers Pin
Blake Miller6-May-11 7:24
Blake Miller6-May-11 7:24 
GeneralRe: Austin Danger Powers Pin
Samuel Cragg12-Apr-11 10:10
Samuel Cragg12-Apr-11 10:10 
GeneralRe: Austin Danger Powers Pin
Fabio Franco13-Apr-11 4:28
professionalFabio Franco13-Apr-11 4:28 
GeneralRe: Austin Danger Powers Pin
AspDotNetDev13-Apr-11 5:02
protectorAspDotNetDev13-Apr-11 5:02 
GeneralRe: Austin Danger Powers Pin
Fabio Franco13-Apr-11 6:08
professionalFabio Franco13-Apr-11 6:08 
GeneralRe: Austin Danger Powers Pin
AspDotNetDev13-Apr-11 6:56
protectorAspDotNetDev13-Apr-11 6:56 
GeneralRe: Austin Danger Powers Pin
Fabio Franco13-Apr-11 7:19
professionalFabio Franco13-Apr-11 7:19 
GeneralRe: Austin Danger Powers Pin
BobJanova15-Apr-11 3:19
BobJanova15-Apr-11 3:19 
JokeRe: Austin Danger Powers Pin
HaBiX20-Apr-11 0:56
HaBiX20-Apr-11 0:56 

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.