Click here to Skip to main content
15,886,689 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: And I will show you how deep the rabbit hole runs !!! Pin
hansoctantan28-Jun-13 0:02
professionalhansoctantan28-Jun-13 0:02 
GeneralRe: And I will show you how deep the rabbit hole runs !!! Pin
Killzone DeathMan28-Jun-13 5:27
Killzone DeathMan28-Jun-13 5:27 
GeneralRe: And I will show you how deep the rabbit hole runs !!! Pin
Lutosław28-Jun-13 13:50
Lutosław28-Jun-13 13:50 
GeneralRe: And I will show you how deep the rabbit hole runs !!! Pin
MarkTJohnson8-Jul-13 8:44
professionalMarkTJohnson8-Jul-13 8:44 
GeneralWhen Gobbledygook, Do Nada (Except Break the Build) PinPopular
AspDotNetDev26-Jun-13 12:11
protectorAspDotNetDev26-Jun-13 12:11 
GeneralRe: When Gobbledygook, Do Nada (Except Break the Build) Pin
lewax0026-Jun-13 13:39
lewax0026-Jun-13 13:39 
GeneralRe: When Gobbledygook, Do Nada (Except Break the Build) Pin
Argonia26-Jun-13 22:03
professionalArgonia26-Jun-13 22:03 
GeneralRe: When Gobbledygook, Do Nada (Except Break the Build) Pin
Richard Deeming26-Jun-13 23:57
mveRichard Deeming26-Jun-13 23:57 
You should see some of the crap *wonderful* third-party VB code I've been asked to help with! Poke tongue | ;-P

Here's a typical example:
VB
Public Shared Function GetBitNr(ByVal TestInteger As Integer, ByVal Nr As Integer) As Integer
   If TestInteger < 0 Then
      If Nr = 32 Then
         Return 1
      End If

      TestInteger = TestInteger + CInt(&H80000000)
   End If

   Dim i As Long = 30
   Dim str As String = ""
   Do While (i > -1)
      If 2 ^ i <= TestInteger Then
         str = str & "1"
         TestInteger = CInt(Math.Round(TestInteger - 2 ^ i))
      ElseIf Left(str, 1) = "1" Then
         str = str & "0"
      End If

      i = i - 1
   Loop

   Dim result As Integer
   If Len(str) >= Nr Then
      result = CInt(Mid(str, Len(str) - Nr + 1, 1))
   Else
      result = 0
   End If

   Return CInt(result)
End Function




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: When Gobbledygook, Do Nada (Except Break the Build) Pin
Argonia27-Jun-13 0:03
professionalArgonia27-Jun-13 0:03 
GeneralRe: When Gobbledygook, Do Nada (Except Break the Build) Pin
OriginalGriff27-Jun-13 0:12
mveOriginalGriff27-Jun-13 0:12 
GeneralRe: When Gobbledygook, Do Nada (Except Break the Build) Pin
Freak3027-Jun-13 0:57
Freak3027-Jun-13 0:57 
GeneralRe: When Gobbledygook, Do Nada (Except Break the Build) Pin
OriginalGriff27-Jun-13 1:07
mveOriginalGriff27-Jun-13 1:07 
GeneralRe: When Gobbledygook, Do Nada (Except Break the Build) Pin
Richard Deeming27-Jun-13 1:56
mveRichard Deeming27-Jun-13 1:56 
GeneralRe: When Gobbledygook, Do Nada (Except Break the Build) Pin
Lutosław28-Jun-13 9:44
Lutosław28-Jun-13 9:44 
GeneralAhh, the joys of Visual Basic Pin
Argonia26-Jun-13 1:42
professionalArgonia26-Jun-13 1:42 
GeneralRe: Ahh, the joys of Visual Basic Pin
Mohammed Hameed26-Jun-13 2:10
professionalMohammed Hameed26-Jun-13 2:10 
GeneralRe: Ahh, the joys of Visual Basic Pin
dusty_dex26-Jun-13 2:29
dusty_dex26-Jun-13 2:29 
GeneralRe: Ahh, the joys of Visual Basic Pin
Herbie Mountjoy26-Jun-13 21:09
professionalHerbie Mountjoy26-Jun-13 21:09 
GeneralRe: Ahh, the joys of Visual Basic Pin
dusty_dex27-Jun-13 1:28
dusty_dex27-Jun-13 1:28 
GeneralRe: Ahh, the joys of Visual Basic Pin
Westm27-Jun-13 6:22
Westm27-Jun-13 6:22 
GeneralRe: Ahh, the joys of Visual Basic Pin
GuyThiebaut26-Jun-13 2:37
professionalGuyThiebaut26-Jun-13 2:37 
GeneralRe: Ahh, the joys of Visual Basic Pin
Argonia26-Jun-13 3:04
professionalArgonia26-Jun-13 3:04 
GeneralRe: Ahh, the joys of Visual Basic Pin
GuyThiebaut26-Jun-13 3:40
professionalGuyThiebaut26-Jun-13 3:40 
GeneralRe: Ahh, the joys of Visual Basic Pin
lewax0026-Jun-13 3:43
lewax0026-Jun-13 3:43 
GeneralRe: Ahh, the joys of Visual Basic Pin
gervacleto28-Jun-13 1:45
professionalgervacleto28-Jun-13 1:45 

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.