Click here to Skip to main content
15,388,892 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: Quick Nap Pin
AspDotNetDev24-Apr-12 7:29
protectorAspDotNetDev24-Apr-12 7:29 
JokeRe: Quick Nap Pin
Albert Holguin24-Apr-12 8:54
professionalAlbert Holguin24-Apr-12 8:54 
GeneralRe: Quick Nap Pin
PIEBALDconsult24-Apr-12 11:58
professionalPIEBALDconsult24-Apr-12 11:58 
GeneralDoh! Pin
Bert Mitton23-Apr-12 1:52
professionalBert Mitton23-Apr-12 1:52 
GeneralRe: Doh! Pin
Brisingr Aerowing23-Apr-12 2:16
professionalBrisingr Aerowing23-Apr-12 2:16 
GeneralRe: Doh! Pin
BillW3323-Apr-12 6:00
professionalBillW3323-Apr-12 6:00 
GeneralRe: Doh! Pin
ekolis23-Apr-12 8:05
Memberekolis23-Apr-12 8:05 
GeneralWhy did I do that? Pin
Benaiah Mischenko18-Apr-12 9:17
MemberBenaiah Mischenko18-Apr-12 9:17 
I'd like to call a hall of shame on myself - or, rather, my coding practices of about six years ago.

Having just jumped into .NET, I was building a periodic table. I (manually) serialized the element data in a double-separated string (I think the separators were | for elements and ; for each of their attributes).

The only problem was, I'd never heard of String.Split. I'd implemented a one-separator splitter once before using String.Substring, but the two-separator splitter was far more complex.

About six hours of coding later, I had around thirty lines of String.Substring (if I still had the files, I would paste in the function). It worked, but looking back, I realize I could have replaced all that with a single line.

Live and learn, I suppose.
GeneralRe: Why did I do that? Pin
CDP180218-Apr-12 9:58
MemberCDP180218-Apr-12 9:58 
GeneralRe: Why did I do that? Pin
yiangos23-Apr-12 22:36
professionalyiangos23-Apr-12 22:36 
GeneralRe: Why did I do that? Pin
BillW3322-Apr-12 2:23
professionalBillW3322-Apr-12 2:23 
GeneralRe: Why did I do that? Pin
CDP180222-Apr-12 6:01
MemberCDP180222-Apr-12 6:01 
GeneralRe: Why did I do that? Pin
Lutosław23-Apr-12 6:39
MemberLutosław23-Apr-12 6:39 
GeneralRe: Why did I do that? Pin
Lupestro24-Apr-12 5:15
MemberLupestro24-Apr-12 5:15 
GeneralRe: Why did I do that? Pin
BobJanova22-Apr-12 22:44
MemberBobJanova22-Apr-12 22:44 
GeneralRe: Why did I do that? Pin
grralph123-Apr-12 23:56
Membergrralph123-Apr-12 23:56 
GeneralRe: Why did I do that? Pin
CDP180224-Apr-12 0:07
MemberCDP180224-Apr-12 0:07 
Generalthe outsourcing curse strikes again!! Pin
I.explore.code17-Apr-12 11:34
MemberI.explore.code17-Apr-12 11:34 
GeneralRe: the outsourcing curse strikes again!! Pin
AspDotNetDev17-Apr-12 12:10
protectorAspDotNetDev17-Apr-12 12:10 
GeneralRe: the outsourcing curse strikes again!! Pin
I.explore.code17-Apr-12 21:55
MemberI.explore.code17-Apr-12 21:55 
GeneralRe: the outsourcing curse strikes again!! Pin
AspDotNetDev18-Apr-12 4:29
protectorAspDotNetDev18-Apr-12 4:29 
GeneralRe: the outsourcing curse strikes again!! Pin
ii_noname_ii18-Apr-12 1:57
Memberii_noname_ii18-Apr-12 1:57 
GeneralRe: the outsourcing curse strikes again!! Pin
Mohibur Rashid17-Apr-12 15:48
professionalMohibur Rashid17-Apr-12 15:48 
GeneralRe: the outsourcing curse strikes again!! Pin
I.explore.code17-Apr-12 21:57
MemberI.explore.code17-Apr-12 21:57 
GeneralRe: the outsourcing curse strikes again!! Pin
Mohibur Rashid18-Apr-12 20:55
professionalMohibur Rashid18-Apr-12 20:55 

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.