Click here to Skip to main content
15,886,919 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: Ah the joys of working in a team Pin
Ravi Bhavnani21-Jan-14 4:58
professionalRavi Bhavnani21-Jan-14 4:58 
GeneralAnother gem from the VB6 code I'm "porting" Pin
Rob Grainger16-Jan-14 23:25
Rob Grainger16-Jan-14 23:25 
GeneralRe: Another gem from the VB6 code I'm "porting" Pin
NormDroid16-Jan-14 23:51
professionalNormDroid16-Jan-14 23:51 
GeneralRe: Another gem from the VB6 code I'm "porting" Pin
Rob Grainger17-Jan-14 0:01
Rob Grainger17-Jan-14 0:01 
GeneralRe: Another gem from the VB6 code I'm "porting" Pin
Chris Quinn17-Jan-14 3:11
Chris Quinn17-Jan-14 3:11 
GeneralRe: Another gem from the VB6 code I'm "porting" Pin
Rob Grainger17-Jan-14 3:16
Rob Grainger17-Jan-14 3:16 
GeneralRe: Another gem from the VB6 code I'm "porting" Pin
Richard Deeming17-Jan-14 1:33
mveRichard Deeming17-Jan-14 1:33 
GeneralRe: Another gem from the VB6 code I'm "porting" Pin
Rob Grainger17-Jan-14 3:10
Rob Grainger17-Jan-14 3:10 
Well spotted - I left that one deliberately to ensure folk are paying attention Wink | ;-)

Actually, most of the real horrors in this particular code base are more subtle and hard to illustrate in short snippets and more to do with putting too much business logic in event handlers for controls. When a form loads, info from the database is written to a control, which fires an event handler, which writes to another control, which fires an event handler, which... I think you get the picture. Business logic is totally interspersed with UI logic - often broken out into separate modules the contents of which have no logical relation. Global variables are used for all sorts of purposes. "Option Strict" has not been used, and frequently variables are not declared anywhere at all... GoTo's and even GoSub's are used liberally.

I'm just glad I'm tasked with rewriting it rather than maintaining it, but it can be software archaeology trying to determine what the heck the original logic was intended to accomplish.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.

GeneralRe: Another gem from the VB6 code I'm "porting" Pin
Richard Deeming17-Jan-14 3:35
mveRichard Deeming17-Jan-14 3:35 
GeneralRe: Another gem from the VB6 code I'm "porting" Pin
Ron Beyer17-Jan-14 4:48
professionalRon Beyer17-Jan-14 4:48 
GeneralRe: Another gem from the VB6 code I'm "porting" Pin
Freak3019-Jan-14 23:41
Freak3019-Jan-14 23:41 
GeneralRe: Another gem from the VB6 code I'm "porting" Pin
Sentenryu20-Jan-14 4:00
Sentenryu20-Jan-14 4:00 
GeneralRe: Another gem from the VB6 code I'm "porting" Pin
Marc Clifton21-Jan-14 2:12
mvaMarc Clifton21-Jan-14 2:12 
GeneralA backslash in C++ Pin
Tsuda Kageyu14-Jan-14 20:56
Tsuda Kageyu14-Jan-14 20:56 
GeneralRe: A backslash in C++ Pin
Duncan Edwards Jones14-Jan-14 21:02
professionalDuncan Edwards Jones14-Jan-14 21:02 
GeneralRe: A backslash in C++ Pin
Bernhard Hiller14-Jan-14 21:04
Bernhard Hiller14-Jan-14 21:04 
GeneralRe: A backslash in C++ Pin
Tsuda Kageyu14-Jan-14 21:13
Tsuda Kageyu14-Jan-14 21:13 
GeneralRe: A backslash in C++ Pin
Bernhard Hiller14-Jan-14 21:44
Bernhard Hiller14-Jan-14 21:44 
GeneralRe: A backslash in C++ Pin
Nicholas Marty15-Jan-14 0:43
professionalNicholas Marty15-Jan-14 0:43 
GeneralRe: A backslash in C++ Pin
Rob Grainger16-Jan-14 23:54
Rob Grainger16-Jan-14 23:54 
GeneralRe: A backslash in C++ Pin
Lutosław17-Jan-14 9:43
Lutosław17-Jan-14 9:43 
GeneralRe: A backslash in C++ Pin
Argonia14-Jan-14 21:25
professionalArgonia14-Jan-14 21:25 
GeneralRe: A backslash in C++ Pin
Pete O'Hanlon14-Jan-14 21:40
mvePete O'Hanlon14-Jan-14 21:40 
GeneralRe: A backslash in C++ Pin
Argonia14-Jan-14 21:50
professionalArgonia14-Jan-14 21:50 
GeneralRe: A backslash in C++ Pin
Pete O'Hanlon14-Jan-14 22:28
mvePete O'Hanlon14-Jan-14 22:28 

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.