Click here to Skip to main content
15,923,051 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: Now that's a first Pin
Wes Jones11-Feb-10 23:33
Wes Jones11-Feb-10 23:33 
GeneralRe: Now that's a first Pin
Chris Maunder13-Feb-10 10:48
cofounderChris Maunder13-Feb-10 10:48 
GeneralRe: Now that's a first Pin
Wes Jones15-Feb-10 7:51
Wes Jones15-Feb-10 7:51 
GeneralRe: Now that's a first Pin
Daniel Grunwald14-Feb-10 22:13
Daniel Grunwald14-Feb-10 22:13 
GeneralRe: Now that's a first Pin
Wes Jones15-Feb-10 7:44
Wes Jones15-Feb-10 7:44 
JokeRe: Now that's a first Pin
Avi Berger17-Feb-10 14:42
Avi Berger17-Feb-10 14:42 
GeneralGood thing that array's big enough Pin
Wes Jones9-Feb-10 8:59
Wes Jones9-Feb-10 8:59 
GeneralRe: Good thing that array's big enough Pin
Jeremy Hutchinson9-Feb-10 10:29
professionalJeremy Hutchinson9-Feb-10 10:29 
GeneralRe: Good thing that array's big enough Pin
Nagy Vilmos10-Feb-10 3:32
professionalNagy Vilmos10-Feb-10 3:32 
GeneralMessage Removed Pin
9-Feb-10 5:17
professionalJeremy Hutchinson9-Feb-10 5:17 
GeneralRe: Bad join Pin
OriginalGriff9-Feb-10 5:27
mveOriginalGriff9-Feb-10 5:27 
GeneralRe: Bad join Pin
Andrew Rissing9-Feb-10 5:56
Andrew Rissing9-Feb-10 5:56 
JokeRe: Bad join Pin
Stanciu Vlad9-Feb-10 9:09
Stanciu Vlad9-Feb-10 9:09 
GeneralRe: Bad join Pin
Jeremy Hutchinson9-Feb-10 10:35
professionalJeremy Hutchinson9-Feb-10 10:35 
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 

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.