Click here to Skip to main content
16,011,757 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.

 
JokeRe: help pls Pin
Vasudevan Deepak Kumar14-Nov-07 1:30
Vasudevan Deepak Kumar14-Nov-07 1:30 
GeneralRe: help pls Pin
Justin Perez14-Nov-07 4:27
Justin Perez14-Nov-07 4:27 
AnswerRe: here's how to use quantum crypto in VB Pin
NimitySSJ29-Nov-07 20:34
NimitySSJ29-Nov-07 20:34 
QuestionWhat's the best way to do conditional compile? Pin
crewchill8-Nov-07 8:04
crewchill8-Nov-07 8:04 
AnswerRe: What's the best way to do conditional compile? Pin
Pete O'Hanlon8-Nov-07 9:19
mvePete O'Hanlon8-Nov-07 9:19 
AnswerRe: What's the best way to do conditional compile? Pin
KarstenK9-Nov-07 3:13
mveKarstenK9-Nov-07 3:13 
AnswerRe: What's the best way to do conditional compile? Pin
Saksida Bojan9-Nov-07 7:04
Saksida Bojan9-Nov-07 7:04 
AnswerRe: What's the best way to do conditional compile? Pin
Mike Dimmick12-Nov-07 5:21
Mike Dimmick12-Nov-07 5:21 
I maintain a thin client which was originally designed for Symbol Series 3000 DOS-based handheld computers. Over time it's been ported to desktop Windows (for testing), Palm (for Symbol's relatively short-lived Palm devices with integrated scanners), other DOS-based handhelds and a variety of Windows CE and Pocket PC-based devices.

The device-specific stuff tended to be implemented originally with #ifdefs but where possible I've replaced that with separate implementations, where the code needed to be completely different. In some places, I've replaced platform defines with feature defines, and added a configuration header which sets the feature defines up appropriately per-platform (unfortunately Microsoft C 6.0 . Finally, to try to keep the number of builds manageable, in some places I've used dynamic loading on CE using LoadLibrary/GetProcAddress to detect whether a feature is supported. This can happen if you're trying to use some manufacturer-specific APIs, for example we try to determine whether a Symbol MC3000 has full waveform-audio support or simply a beeper. The waveform-audio version supports the beeper API but with a significant amount of latency, so we use our own waveform-generator where possible (and of course it's necessary on the non-Symbol devices anyway).


DoEvents: Generating unexpected recursion since 1991

AnswerRe: What's the best way to do conditional compile? Pin
earl the dead cat12-Nov-07 7:39
earl the dead cat12-Nov-07 7:39 
GeneralRe: What's the best way to do conditional compile? Pin
crewchill12-Nov-07 7:55
crewchill12-Nov-07 7:55 
AnswerRe: What's the best way to do conditional compile? Pin
Philip Laureano14-Nov-07 4:38
Philip Laureano14-Nov-07 4:38 
AnswerRe: by avoiding it... Pin
NimitySSJ29-Nov-07 20:40
NimitySSJ29-Nov-07 20:40 
QuestionHow to code complicated actuarial formulas in C#?! Pin
k3n3dy7-Nov-07 10:07
k3n3dy7-Nov-07 10:07 
AnswerRe: How to code complicated actuarial formulas in C#?! Pin
Pete O'Hanlon7-Nov-07 11:17
mvePete O'Hanlon7-Nov-07 11:17 
GeneralRe: How to code complicated actuarial formulas in C#?! Pin
_Damian S_7-Nov-07 12:04
professional_Damian S_7-Nov-07 12:04 
GeneralRe: How to code complicated actuarial formulas in C#?! Pin
jg_8-Nov-07 4:24
jg_8-Nov-07 4:24 
JokeRe: How to code complicated actuarial formulas in C#?! Pin
Vasudevan Deepak Kumar8-Nov-07 21:30
Vasudevan Deepak Kumar8-Nov-07 21:30 
GeneralRe: How to code complicated actuarial formulas in C#?! Pin
jg_9-Nov-07 1:49
jg_9-Nov-07 1:49 
AnswerRe: How to code complicated actuarial formulas in C#?! Pin
_Damian S_7-Nov-07 12:03
professional_Damian S_7-Nov-07 12:03 
AnswerRe: How to code complicated actuarial formulas in C#?! Pin
KarstenK8-Nov-07 1:06
mveKarstenK8-Nov-07 1:06 
GeneralRe: How to code complicated actuarial formulas in C#?! Pin
Pete O'Hanlon8-Nov-07 1:41
mvePete O'Hanlon8-Nov-07 1:41 
GeneralRe: How to code complicated actuarial formulas in C#?! Pin
jhwurmbach8-Nov-07 23:05
jhwurmbach8-Nov-07 23:05 
GeneralRe: How to code complicated actuarial formulas in C#?! Pin
Phil J Pearson8-Nov-07 2:06
Phil J Pearson8-Nov-07 2:06 
GeneralRe: How to code complicated actuarial formulas in C#?! Pin
Russell Jones13-Nov-07 2:51
Russell Jones13-Nov-07 2:51 
AnswerRe: How to code complicated actuarial formulas in C#?! Pin
jhwurmbach8-Nov-07 21:47
jhwurmbach8-Nov-07 21:47 

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.