Click here to Skip to main content
15,913,610 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: MSDN example Pin
0x3c015-Apr-09 4:49
0x3c015-Apr-09 4:49 
GeneralRe: MSDN example Pin
leppie15-Apr-09 5:00
leppie15-Apr-09 5:00 
GeneralRe: MSDN example Pin
supercat921-Apr-09 7:52
supercat921-Apr-09 7:52 
JokeRe: MSDN example Pin
Ian Shlasko15-Apr-09 3:44
Ian Shlasko15-Apr-09 3:44 
GeneralRe: MSDN example Pin
Yusuf15-Apr-09 3:58
Yusuf15-Apr-09 3:58 
GeneralRe: MSDN example [modified] (oops, my bad!) Pin
Lutosław15-Apr-09 11:23
Lutosław15-Apr-09 11:23 
GeneralWhy use the 'instanceof' Java operator when you can rethrow an exception? Pin
Juan1R13-Apr-09 3:49
Juan1R13-Apr-09 3:49 
GeneralSince you all like his code so well. Pin
EyeYamFedUp3-Apr-09 5:53
EyeYamFedUp3-Apr-09 5:53 
Here's another example of some great coding skills. I'm thinking he get's paid in CPU cycles used by application AND lines of code written.
'*********************************************************************
'*  FindCharacters
'*
'*  This subroutine finds and optionally replaces specific characters
'*    with another chjaracter.  It also returns the position(s) of
'*    specific characters not in the string.
'*********************************************************************

Public Sub FindCharacters(ByRef strData As String, _
                          ByVal strValidCharSet As String, _
                          ByVal strReplChar As String, _
                          ByRef strMsg As String)

Dim strWork As String
Dim strCH As String
Dim intLoop As Integer

strWork = ""
strMsg = ""

For intLoop = 0 To strData.Length - 1
  strCH = strData.Substring(intLoop, 1)

  If strValidCharSet.IndexOf(strCH) = -1 Then
    strWork = String.Concat(strWork, strReplChar)
    strMsg = String.Concat(strMsg, (intLoop + 1).ToString, ", ")
  Else
    strWork = String.Concat(strWork, strCH)
  End If
Next

If strMsg <> "" Then
  strMsg = strMsg.Substring(0, strMsg.Length - 2)
End If

strData = strWork

End Sub

GeneralRe: Since you all like his code so well. Pin
Yusuf3-Apr-09 6:28
Yusuf3-Apr-09 6:28 
JokeHouse, I need a lobotomy Pin
fabrice.leal3-Apr-09 6:52
fabrice.leal3-Apr-09 6:52 
GeneralGuess His Experience Level Pin
EyeYamFedUp1-Apr-09 8:00
EyeYamFedUp1-Apr-09 8:00 
GeneralRe: Guess His Experience Level Pin
fred_1-Apr-09 8:22
fred_1-Apr-09 8:22 
GeneralRe: Guess His Experience Level Pin
EyeYamFedUp1-Apr-09 8:43
EyeYamFedUp1-Apr-09 8:43 
GeneralRe: Guess His Experience Level Pin
Daniel 'Tak' M.1-Apr-09 9:45
Daniel 'Tak' M.1-Apr-09 9:45 
GeneralRe: Guess His Experience Level Pin
Yusuf1-Apr-09 14:49
Yusuf1-Apr-09 14:49 
GeneralRe: Guess His Experience Level Pin
Viral Upadhyay2-Apr-09 0:06
Viral Upadhyay2-Apr-09 0:06 
GeneralRe: Guess His Experience Level Pin
Thomas Weller2-Apr-09 0:57
Thomas Weller2-Apr-09 0:57 
JokeRe: Guess His Experience Level Pin
BadKarma2-Apr-09 22:14
BadKarma2-Apr-09 22:14 
JokeRe: Guess His Experience Level Pin
Thomas Weller3-Apr-09 2:49
Thomas Weller3-Apr-09 2:49 
GeneralRe: Guess His Experience Level Pin
akyriako782-Apr-09 1:51
akyriako782-Apr-09 1:51 
GeneralRe: Guess His Experience Level Pin
akyriako782-Apr-09 1:57
akyriako782-Apr-09 1:57 
GeneralRe: Guess His Experience Level Pin
EyeYamFedUp2-Apr-09 2:28
EyeYamFedUp2-Apr-09 2:28 
GeneralRe: Guess His Experience Level Pin
akyriako782-Apr-09 21:31
akyriako782-Apr-09 21:31 
GeneralRe: KISS and Structured Code [modified] Pin
Tristan Rhodes3-Apr-09 0:40
Tristan Rhodes3-Apr-09 0:40 
GeneralRe: KISS and Structured Code Pin
Pete O'Hanlon3-Apr-09 2:02
mvePete O'Hanlon3-Apr-09 2:02 

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.