Click here to Skip to main content
15,886,963 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: Re-using variables can be dangerous Pin
robocodeboy24-Mar-14 1:23
robocodeboy24-Mar-14 1:23 
GeneralRe: Re-using variables can be dangerous Pin
kmoorevs24-Mar-14 10:06
kmoorevs24-Mar-14 10:06 
GeneralThis code base is the gift that just keeps giving PinPopular
Rob Grainger12-Mar-14 23:59
Rob Grainger12-Mar-14 23:59 
GeneralRe: This code base is the gift that just keeps giving Pin
Brisingr Aerowing18-Mar-14 14:52
professionalBrisingr Aerowing18-Mar-14 14:52 
GeneralRe: This code base is the gift that just keeps giving Pin
Kornfeld Eliyahu Peter18-Mar-14 21:10
professionalKornfeld Eliyahu Peter18-Mar-14 21:10 
GeneralRe: This code base is the gift that just keeps giving Pin
Rob Grainger19-Mar-14 0:27
Rob Grainger19-Mar-14 0:27 
GeneralRe: This code base is the gift that just keeps giving Pin
Kornfeld Eliyahu Peter19-Mar-14 0:55
professionalKornfeld Eliyahu Peter19-Mar-14 0:55 
GeneralRe: This code base is the gift that just keeps giving Pin
Gary R. Wheeler22-Mar-14 1:46
Gary R. Wheeler22-Mar-14 1:46 
I feel your pain Rob. I've spent the last three weeks on a refactoring job that was supposed to last two days at most. The guy who wrote the original code was pretty sharp, with a deep background in embedded development in C. Unfortunately, the code in question is for a Windows service written in C++. Unsafe pointer casts everywhere, no attempt to follow the group naming convention, class member variables that were unused, lots of pointer arithmetic rather than straightforward array indexing, locals that were initialized and never referenced, the list goes on. The worst was the mix of MFC and STL collection classes. I spent four days alone getting the thing to shutdown without throwing exceptions or locking up due to threading issues.
Software Zen: delete this;

GeneralRe: This code base is the gift that just keeps giving Pin
Rob Grainger23-Mar-14 6:42
Rob Grainger23-Mar-14 6:42 
GeneralRe: This code base is the gift that just keeps giving Pin
Henry Skoglund24-Mar-14 11:56
Henry Skoglund24-Mar-14 11:56 
GeneralA new low in in-line SQL Pin
Duncan Edwards Jones12-Mar-14 7:40
professionalDuncan Edwards Jones12-Mar-14 7:40 
GeneralRe: A new low in in-line SQL PinPopular
dan!sh 12-Mar-14 8:04
professional dan!sh 12-Mar-14 8:04 
GeneralRe: A new low in in-line SQL PinPopular
Jörgen Andersson12-Mar-14 10:51
professionalJörgen Andersson12-Mar-14 10:51 
GeneralRe: A new low in in-line SQL Pin
dan!sh 12-Mar-14 17:47
professional dan!sh 12-Mar-14 17:47 
GeneralThe Never Executed Loop Pin
Bernhard Hiller12-Mar-14 1:56
Bernhard Hiller12-Mar-14 1:56 
GeneralRe: The Never Executed Loop Pin
Ravi Bhavnani12-Mar-14 2:45
professionalRavi Bhavnani12-Mar-14 2:45 
GeneralRe: The Never Executed Loop Pin
Sergey Alexandrovich Kryukov29-Apr-14 18:51
mvaSergey Alexandrovich Kryukov29-Apr-14 18:51 
GeneralRe: The Never Executed Loop Pin
Ravi Bhavnani30-Apr-14 2:17
professionalRavi Bhavnani30-Apr-14 2:17 
GeneralRe: The Never Executed Loop Pin
jeron112-Mar-14 6:41
jeron112-Mar-14 6:41 
GeneralRe: The Never Executed Loop Pin
Adam R Harris12-Mar-14 9:15
Adam R Harris12-Mar-14 9:15 
GeneralRe: The Never Executed Loop Pin
Shameel13-Mar-14 0:38
professionalShameel13-Mar-14 0:38 
GeneralRe: The Never Executed Loop Pin
jeron113-Mar-14 6:48
jeron113-Mar-14 6:48 
GeneralRe: The Never Executed Loop Pin
TheGreatAndPowerfulOz3-Apr-14 6:06
TheGreatAndPowerfulOz3-Apr-14 6:06 
GeneralRe: The Never Executed Loop Pin
Bernhard Hiller13-Mar-14 1:08
Bernhard Hiller13-Mar-14 1:08 
GeneralRe: The Never Executed Loop Pin
BillW3312-Mar-14 10:22
professionalBillW3312-Mar-14 10:22 

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.