Click here to Skip to main content
15,311,497 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: Is this the worst code in the world? Pin
Power Puff Boy13-Aug-15 3:28
MemberPower Puff Boy13-Aug-15 3:28 
GeneralRe: Is this the worst code in the world? Pin
Mark Whybird13-Aug-15 20:26
MemberMark Whybird13-Aug-15 20:26 
GeneralRe: Is this the worst code in the world? Pin
Member 1070767713-Aug-15 23:02
MemberMember 1070767713-Aug-15 23:02 
GeneralRe: Is this the worst code in the world? Pin
Mark Whybird13-Aug-15 20:47
MemberMark Whybird13-Aug-15 20:47 
GeneralRe: Is this the worst code in the world? Pin
Weston Miller14-Aug-15 3:32
MemberWeston Miller14-Aug-15 3:32 
GeneralRe: Is this the worst code in the world? Pin
Kirk 1038982114-Aug-15 4:01
MemberKirk 1038982114-Aug-15 4:01 
GeneralRe: Is this the worst code in the world? Pin
Dan Sutton14-Aug-15 7:24
MemberDan Sutton14-Aug-15 7:24 
GeneralRe: Is this the worst code in the world? Pin
Dan Sutton14-Aug-15 7:29
MemberDan Sutton14-Aug-15 7:29 
...although, thinking about it, arguably the worst code in the world came about as a result of an undocumented instruction in the 80286 which Intel originally included for testing.

The way the instruction worked, you filled up an area in page 0 of memory with all the values you wanted all the registers in the chip to have (including instruction pointer, stack pointer, flags, etc.) and whether you wanted to run in real mode (640K) or extended mode (all the memory available) and where in the larger memory map you wanted your 640K to be... and so on - and then you could execute the instruction and the chip would cold-start in that state.

The worst code in the world that I'm talking about, then, was the first version of OS/2, written for that chip, which allowed you to have one - and only one - DOS window running at any time. And - yes - IBM made that work by hooking onto Interrupt 8 (the hardware timer) and cold-starting the 80286 eighteen times a second, flipping between real mode and extended mode each time around. Horrible. Amazingly, it actually worked... I shudder to think what the chipset around the chip was thinking at the time, but there it is.
GeneralRe: Is this the worst code in the world? Pin
PIEBALDconsult14-Aug-15 7:34
professionalPIEBALDconsult14-Aug-15 7:34 
GeneralRe: Is this the worst code in the world? Pin
BrainiacV14-Aug-15 9:43
MemberBrainiacV14-Aug-15 9:43 
GeneralRe: Is this the worst code in the world? Pin
Manfred Rudolf Bihy14-Aug-15 9:51
professionalManfred Rudolf Bihy14-Aug-15 9:51 
GeneralRe: Is this the worst code in the world? Pin
jibalt14-Aug-15 12:29
Memberjibalt14-Aug-15 12:29 
GeneralRe: Is this the worst code in the world? Pin
Al Chak15-Aug-15 22:16
MemberAl Chak15-Aug-15 22:16 
GeneralRe: Is this the worst code in the world? Pin
Dr Gadgit30-Sep-15 8:24
MemberDr Gadgit30-Sep-15 8:24 
GeneralRe: Is this the worst code in the world? Pin
BruceN5-Oct-15 9:39
MemberBruceN5-Oct-15 9:39 
GeneralWtf JS? Pin
jan larsen12-Aug-15 1:16
Memberjan larsen12-Aug-15 1:16 
GeneralRe: Wtf JS? Pin
Vark11112-Aug-15 3:32
MemberVark11112-Aug-15 3:32 
GeneralRe: Wtf JS? Pin
jan larsen12-Aug-15 20:59
Memberjan larsen12-Aug-15 20:59 
GeneralRe: Wtf JS? Pin
jsc4212-Aug-15 3:50
professionaljsc4212-Aug-15 3:50 
GeneralRe: Wtf JS? Pin
jan larsen12-Aug-15 21:10
Memberjan larsen12-Aug-15 21:10 
GeneralRe: Wtf JS? Pin
Vark11113-Aug-15 3:49
MemberVark11113-Aug-15 3:49 
GeneralRe: Wtf JS? Pin
imagiro13-Aug-15 20:07
Memberimagiro13-Aug-15 20:07 
Generalhhg Pin
susanjita7-Aug-15 21:14
Membersusanjita7-Aug-15 21:14 
GeneralRe: hhg Pin
PIEBALDconsult9-Aug-15 6:52
professionalPIEBALDconsult9-Aug-15 6:52 
GeneralRe: hhg Pin
Brisingr Aerowing9-Aug-15 8:40
professionalBrisingr Aerowing9-Aug-15 8:40 

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.