Click here to Skip to main content
15,881,882 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: Beginner's Shame: Manually Draw Characters Pin
Luc Pattyn25-Aug-10 11:34
sitebuilderLuc Pattyn25-Aug-10 11:34 
GeneralRe: Beginner's Shame: Manually Draw Characters Pin
AspDotNetDev25-Aug-10 12:52
protectorAspDotNetDev25-Aug-10 12:52 
GeneralRe: Beginner's Shame: Manually Draw Characters Pin
Luc Pattyn25-Aug-10 13:23
sitebuilderLuc Pattyn25-Aug-10 13:23 
GeneralRe: Beginner's Shame: Manually Draw Characters Pin
Baconbutty26-Aug-10 3:17
Baconbutty26-Aug-10 3:17 
GeneralRe: Beginner's Shame: Manually Draw Characters Pin
BillW3326-Aug-10 5:42
professionalBillW3326-Aug-10 5:42 
GeneralRe: Beginner's Shame: Manually Draw Characters Pin
Stefan_Lang31-Aug-10 6:42
Stefan_Lang31-Aug-10 6:42 
GeneralRe: Beginner's Shame: Manually Draw Characters Pin
AspDotNetDev31-Aug-10 8:19
protectorAspDotNetDev31-Aug-10 8:19 
GeneralThat may have been a mistake... PinPopular
OriginalGriff20-Aug-10 23:16
mveOriginalGriff20-Aug-10 23:16 
As some of you may know, I created a Tip/Trick recently about converting numbers to the word equivalent (523 to "Five hundred and twenty three"). With my tongue firmly rammed into my cheek, I suggested that a switch statement would be a good way to do it.
Well, it's Saturday, and I thought to myself "A switch has got to be faster than the proper way - I wonder how much faster?" So I thought I'd check.
I wrote and tested a proper version and used it to generate the Big Switch code I'd need, writing it to a text file "BigSwitch.cs". Then I could include this and do a side-by-side comparison. Initial testing of the "proper" way to do it suggested that one million iterations should test all code paths and eliminate cached jitter in the results.
So, I made my mistake. I double clicked on the "BigSwitch.cs" file I had created. VS2008 started to load it.
I'm still not sure if it would have suceeded; I killed the process after 30 minutes. Note to self: Do not attempt to load 82.7 Mb code fragments into VS again... Blush | :O
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.

GeneralRe: That may have been a mistake... Pin
PIEBALDconsult21-Aug-10 4:22
mvePIEBALDconsult21-Aug-10 4:22 
GeneralRe: That may have been a mistake... Pin
OriginalGriff21-Aug-10 4:30
mveOriginalGriff21-Aug-10 4:30 
GeneralRe: That may have been a mistake... Pin
PIEBALDconsult21-Aug-10 4:39
mvePIEBALDconsult21-Aug-10 4:39 
GeneralRe: That may have been a mistake... Pin
OriginalGriff21-Aug-10 4:41
mveOriginalGriff21-Aug-10 4:41 
GeneralRe: That may have been a mistake... Pin
Jeroen De Dauw21-Aug-10 4:35
Jeroen De Dauw21-Aug-10 4:35 
GeneralRe: That may have been a mistake... Pin
OriginalGriff21-Aug-10 4:39
mveOriginalGriff21-Aug-10 4:39 
GeneralRe: That may have been a mistake... Pin
Jeroen De Dauw21-Aug-10 4:41
Jeroen De Dauw21-Aug-10 4:41 
GeneralRe: That may have been a mistake... Pin
OriginalGriff21-Aug-10 4:42
mveOriginalGriff21-Aug-10 4:42 
AnswerRe: That may have been a mistake... PinPopular
Luc Pattyn22-Aug-10 9:17
sitebuilderLuc Pattyn22-Aug-10 9:17 
GeneralRe: That may have been a mistake... Pin
OriginalGriff22-Aug-10 9:28
mveOriginalGriff22-Aug-10 9:28 
GeneralRe: That may have been a mistake... Pin
Luc Pattyn22-Aug-10 10:03
sitebuilderLuc Pattyn22-Aug-10 10:03 
GeneralRe: That may have been a mistake... Pin
OriginalGriff22-Aug-10 11:40
mveOriginalGriff22-Aug-10 11:40 
GeneralRe: That may have been a mistake... Pin
Luc Pattyn22-Aug-10 11:50
sitebuilderLuc Pattyn22-Aug-10 11:50 
GeneralRe: That may have been a mistake... Pin
OriginalGriff22-Aug-10 22:00
mveOriginalGriff22-Aug-10 22:00 
GeneralRe: That may have been a mistake... Pin
PIEBALDconsult22-Aug-10 11:55
mvePIEBALDconsult22-Aug-10 11:55 
GeneralRe: That may have been a mistake... Pin
Luc Pattyn22-Aug-10 12:00
sitebuilderLuc Pattyn22-Aug-10 12:00 
GeneralRe: That may have been a mistake... Pin
PIEBALDconsult22-Aug-10 17:48
mvePIEBALDconsult22-Aug-10 17:48 

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.