Click here to Skip to main content
15,881,559 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: Philosophy Major bad Programmer Pin
cpkilekofp14-Oct-11 10:12
cpkilekofp14-Oct-11 10:12 
GeneralRe: Philosophy Major bad Programmer Pin
Frank Towle16-Oct-11 3:57
Frank Towle16-Oct-11 3:57 
GeneralRe: Philosophy Major bad Programmer Pin
BobJanova11-Oct-11 0:01
BobJanova11-Oct-11 0:01 
GeneralRe: Philosophy Major bad Programmer Pin
jschell10-Oct-11 8:00
jschell10-Oct-11 8:00 
GeneralRe: Philosophy Major bad Programmer Pin
Frank Towle10-Oct-11 9:18
Frank Towle10-Oct-11 9:18 
GeneralRe: Philosophy Major bad Programmer Pin
Jay Nelson12-Oct-11 10:06
Jay Nelson12-Oct-11 10:06 
GeneralRe: Philosophy Major bad Programmer Pin
Frank Towle13-Oct-11 5:04
Frank Towle13-Oct-11 5:04 
GeneralWhat could they have been thinking? Pin
John Hunley6-Oct-11 4:00
John Hunley6-Oct-11 4:00 
Recently my group was asked to troubleshoot an embedded program written by our overseas sister company, which was "never coming up" and their engineers(?) couldn't figure out why. A few seconds of perusing revealed the following in the middle of the program's initialization code:
C++


for (long i = 0; i < 99999L; i++) dlytsk(cur_task, DLY_SECS, 9999);


The dlytsk function causes the calling task to sleep for the specified number of seconds. So the effect of this snippet was to sleep for around 32 years before allowing initialization to complete. One has to wonder what the original intent was (both of the programmer and the manager who hired him!).
GeneralRe: What could they have been thinking? Pin
witm556-Oct-11 4:09
witm556-Oct-11 4:09 
GeneralRe: What could they have been thinking? Pin
ekolis6-Oct-11 7:55
ekolis6-Oct-11 7:55 
GeneralRe: What could they have been thinking? Pin
killabyte6-Oct-11 13:32
killabyte6-Oct-11 13:32 
GeneralRe: What could they have been thinking? Pin
Bernhard Hiller6-Oct-11 21:20
Bernhard Hiller6-Oct-11 21:20 
GeneralRe: What could they have been thinking? Pin
prasun.r7-Dec-11 5:18
prasun.r7-Dec-11 5:18 
GeneralRe: What could they have been thinking? PinPopular
ricmil4210-Oct-11 3:27
ricmil4210-Oct-11 3:27 
GeneralRe: What could they have been thinking? Pin
Jyothikarthik_N12-Oct-11 3:13
Jyothikarthik_N12-Oct-11 3:13 
GeneralRe: What could they have been thinking? Pin
scotchfaster24-Oct-11 13:03
scotchfaster24-Oct-11 13:03 
GeneralConverting binary to decimal the hard way Pin
PIEBALDconsult5-Oct-11 22:03
mvePIEBALDconsult5-Oct-11 22:03 
GeneralRe: Converting binary to decimal the hard way Pin
Peter_in_27806-Oct-11 0:10
professionalPeter_in_27806-Oct-11 0:10 
GeneralRe: Converting binary to decimal the hard way Pin
phil.o6-Oct-11 0:31
professionalphil.o6-Oct-11 0:31 
GeneralRe: Converting binary to decimal the hard way Pin
PIEBALDconsult7-Oct-11 2:44
mvePIEBALDconsult7-Oct-11 2:44 
GeneralI give in! Pin
Peter_in_27806-Oct-11 20:55
professionalPeter_in_27806-Oct-11 20:55 
GeneralRe: I give in! Pin
Firo Atrum Ventus6-Oct-11 23:09
Firo Atrum Ventus6-Oct-11 23:09 
GeneralI have one that its obvious. Pin
hansoctantan5-Oct-11 20:05
professionalhansoctantan5-Oct-11 20:05 
GeneralRe: I have one that its obvious. Pin
witm556-Oct-11 4:12
witm556-Oct-11 4:12 
GeneralRe: I have one that its obvious. Pin
hansoctantan7-Oct-11 0:15
professionalhansoctantan7-Oct-11 0:15 

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.