Click here to Skip to main content
15,889,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: Bad join Pin
Nagy Vilmos10-Feb-10 3:33
professionalNagy Vilmos10-Feb-10 3:33 
GeneralRe: Bad join Pin
Vasudevan Deepak Kumar10-Feb-10 22:34
Vasudevan Deepak Kumar10-Feb-10 22:34 
GeneralAnother fine gem mined from the codebase Pin
Wes Jones5-Feb-10 13:29
Wes Jones5-Feb-10 13:29 
JokeRe: Another fine gem mined from the codebase Pin
Jeroen De Dauw5-Feb-10 21:19
Jeroen De Dauw5-Feb-10 21:19 
GeneralRe: Another fine gem mined from the codebase Pin
Lutosław7-Feb-10 2:41
Lutosław7-Feb-10 2:41 
GeneralRe: Another fine gem mined from the codebase Pin
Wes Jones7-Feb-10 6:05
Wes Jones7-Feb-10 6:05 
GeneralRe: Another fine gem mined from the codebase Pin
Lutosław7-Feb-10 12:51
Lutosław7-Feb-10 12:51 
GeneralGoSub Return's Pin
Rob Grainger4-Feb-10 4:57
Rob Grainger4-Feb-10 4:57 
Imagine my horror to find the following code style employed in a body of code I've inherited (VBA, hopefully I'll be able to migrate it away)..

I must say though, there's one VB6/VBA feature I stumbled across in code at work today that makes all these pale into insignificance for obfuscation potential. It's our old friend GoSub/Return.

Function MyFunction
    ' Do some stuff
    GoSub CheckRoutine

    ' Other Stuff
    GoTo TheEnd

CheckRoutine:
    ' More stuff
    Return

TheEnd:

    ' Cleanup
End Function


Refactoring this steaming pile's gonna be fun. (The original function is 250 lines, and oddly, it calls other functions/subs, as well as using GoSub to access "nested" functions).

Last time I saw that pair of keywords actually used in a program dates back to my 2nd computer - the ZX Spectrum. Please reassure me that Microsoft had the good sense to remove these before the advent of VB.NET
GeneralRe: GoSub Return's Pin
Luc Pattyn4-Feb-10 5:11
sitebuilderLuc Pattyn4-Feb-10 5:11 
GeneralRe: GoSub Return's Pin
Rob Grainger4-Feb-10 8:53
Rob Grainger4-Feb-10 8:53 
GeneralRe: GoSub Return's Pin
Nagy Vilmos4-Feb-10 10:31
professionalNagy Vilmos4-Feb-10 10:31 
GeneralRe: GoSub Return's Pin
David Skelly4-Feb-10 22:42
David Skelly4-Feb-10 22:42 
GeneralRe: GoSub Return's Pin
Tim Carmichael4-Feb-10 8:53
Tim Carmichael4-Feb-10 8:53 
GeneralWhere may I find this person, their immediate family, anscestors and future descendants so I may take revenge upon them all? Pin
Wes Jones3-Feb-10 12:37
Wes Jones3-Feb-10 12:37 
GeneralRe: Where may I find this person, their immediate family, anscestors and future descendants so I may take revenge upon them all? PinPopular
Luc Pattyn3-Feb-10 13:00
sitebuilderLuc Pattyn3-Feb-10 13:00 
GeneralRe: Where may I find this person, their immediate family, anscestors and future descendants so I may take revenge upon them all? PinPopular
Keith Barrow4-Feb-10 0:52
professionalKeith Barrow4-Feb-10 0:52 
GeneralRe: Where may I find this person, their immediate family, anscestors and future descendants so I may take revenge upon them all? Pin
Wes Jones5-Feb-10 13:19
Wes Jones5-Feb-10 13:19 
GeneralRe: Where may I find this person, their immediate family, anscestors and future descendants so I may take revenge upon them all? Pin
NavnathKale29-Mar-10 2:46
NavnathKale29-Mar-10 2:46 
GeneralRe: Where may I find this person, their immediate family, anscestors and future descendants so I may take revenge upon them all? Pin
Distind4-Feb-10 4:19
Distind4-Feb-10 4:19 
JokeRe: Where may I find this person, their immediate family, anscestors and future descendants so I may take revenge upon them all? Pin
Jeremy Tierman4-Feb-10 11:38
Jeremy Tierman4-Feb-10 11:38 
GeneralRe: Where may I find this person, their immediate family, anscestors and future descendants so I may take revenge upon them all? Pin
Lutosław7-Feb-10 2:56
Lutosław7-Feb-10 2:56 
GeneralRe: Where may I find this person, their immediate family, anscestors and future descendants so I may take revenge upon them all? Pin
Jörgen Andersson9-Feb-10 10:51
professionalJörgen Andersson9-Feb-10 10:51 
GeneralCBool(IIf(BooleanFunction(), True, False)) PinPopular
Gregory Gadow1-Feb-10 6:59
Gregory Gadow1-Feb-10 6:59 
GeneralRe: CBool(IIf(BooleanFunction(), True, False)) Pin
Wes Jones5-Feb-10 13:40
Wes Jones5-Feb-10 13:40 
GeneralWTF Was This Guy Thinking!!! [modified] Pin
Kevin Marois25-Jan-10 5:25
professionalKevin Marois25-Jan-10 5:25 

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.