Click here to Skip to main content
15,884,176 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
Nagy Vilmos28-Jun-13 2:09
professionalNagy Vilmos28-Jun-13 2:09 
GeneralRe: And I will show you how deep the rabbit hole runs !!! Pin
Killzone DeathMan28-Jun-13 5:29
Killzone DeathMan28-Jun-13 5:29 
GeneralRe: And I will show you how deep the rabbit hole runs !!! Pin
vonb26-Jun-13 19:26
vonb26-Jun-13 19:26 
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 
VB.NET
Dim strBrowser As String = Request.Browser.Browser.ToString()
Dim strBroswerVersion As String = Request.Browser.Version.ToString()
If strBrowser.ToString() = "IE" Then
    If IsNumeric(strBroswerVersion.ToString()) Then
        If strBroswerVersion < 9 Then
            ' Do absolutely nothing. Really, nothing at all.
        End If
    End If
End If

While fixing compiler errors after enabling option strict, I have come across a prodigious level of crap. I can't post it all, but this one stood out for being crap on almost every level imaginable. Here are a few notes off the top of my head:
  • Generally, you should avoid checking browser versions, especially in server-side code (I believe the reasoning is that older browsers are slower, so some value was changed).
  • Compilation breaks when trying to compare a string against a number.
  • Anything this would have done has been commented out, so it does nothing.
  • Calling ToString on a string (which I think might even throw a null reference exception if the original string is null)... four times.
  • Comparing strings without ignoring case.
  • The commented out code (not shown) would have caused a compiler error too (attempt to divide a string by a number).
  • Hungarian notation.

Can I cry yet? Cry | :((

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 
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 

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.