Click here to Skip to main content
15,889,216 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: When the CEO becomes a developer II Pin
imagiro4-Nov-10 6:31
imagiro4-Nov-10 6:31 
GeneralRe: When the CEO becomes a developer II PinPopular
PIEBALDconsult4-Nov-10 17:15
mvePIEBALDconsult4-Nov-10 17:15 
GeneralRe: When the CEO becomes a developer II PinPopular
Nagy Vilmos7-Nov-10 21:54
professionalNagy Vilmos7-Nov-10 21:54 
GeneralRe: When the CEO becomes a developer II Pin
Peter_in_27807-Nov-10 23:34
professionalPeter_in_27807-Nov-10 23:34 
GeneralRe: When the CEO becomes a developer II Pin
Charvak Karpe8-Nov-10 6:37
Charvak Karpe8-Nov-10 6:37 
GeneralRe: When the CEO becomes a developer II Pin
djdanlib8-Nov-10 6:53
djdanlib8-Nov-10 6:53 
GeneralRe: When the CEO becomes a developer II Pin
Dave Kreskowiak9-Nov-10 6:47
mveDave Kreskowiak9-Nov-10 6:47 
GeneralRe: When the CEO becomes a developer II Pin
Charvak Karpe9-Nov-10 6:56
Charvak Karpe9-Nov-10 6:56 
#define SECONDS_IN_A_DAY 86400

is clearer and slightly educational to the reader, so definitely a better solution

You trivialize my approach as using "magic numbers", but in the real world probably 90% of the population can tell what you're doing if you do 24 * 60 * 60 whilst maybe 15% of people know what 86400 is. So, I'd still say 24 * 60 * 60 is clearer than 86400 despite it being 3 "magic numbers" instead of 1. Astonishingly, if you add a fourth magic number, nearly every literate human on the Western calendar understands it with no explanation: "365 * 24 * 60 * 60".
GeneralRe: When the CEO becomes a developer II Pin
Dave Kreskowiak9-Nov-10 13:02
mveDave Kreskowiak9-Nov-10 13:02 
GeneralRe: When the CEO becomes a developer II Pin
AspDotNetDev8-Nov-10 14:26
protectorAspDotNetDev8-Nov-10 14:26 
GeneralRe: When the CEO becomes a developer II Pin
Peter_in_27808-Nov-10 14:45
professionalPeter_in_27808-Nov-10 14:45 
GeneralRe: When the CEO becomes a developer II Pin
AspDotNetDev8-Nov-10 15:16
protectorAspDotNetDev8-Nov-10 15:16 
GeneralRe: When the CEO becomes a developer II Pin
Peter_in_27808-Nov-10 16:02
professionalPeter_in_27808-Nov-10 16:02 
GeneralRange-Checking (not) PinPopular
Rob Grainger3-Nov-10 5:27
Rob Grainger3-Nov-10 5:27 
GeneralRe: Range-Checking (not) Pin
AspDotNetDev3-Nov-10 6:45
protectorAspDotNetDev3-Nov-10 6:45 
GeneralRe: Range-Checking (not) Pin
Dalek Dave3-Nov-10 6:49
professionalDalek Dave3-Nov-10 6:49 
GeneralRe: Range-Checking (not) Pin
AspDotNetDev3-Nov-10 7:16
protectorAspDotNetDev3-Nov-10 7:16 
GeneralRe: Range-Checking (not) Pin
Rob Grainger4-Nov-10 1:52
Rob Grainger4-Nov-10 1:52 
GeneralRe: Range-Checking (not) Pin
richard_k7-Nov-10 22:02
richard_k7-Nov-10 22:02 
GeneralThe non-blocking command line parameter Pin
Bernhard Hiller1-Nov-10 22:51
Bernhard Hiller1-Nov-10 22:51 
GeneralRe: The non-blocking command line parameter Pin
fjdiewornncalwe2-Nov-10 1:24
professionalfjdiewornncalwe2-Nov-10 1:24 
GeneralRe: The non-blocking command line parameter Pin
Fueled By Decaff8-Nov-10 19:37
Fueled By Decaff8-Nov-10 19:37 
GeneralALWAYS USE A STRINGBUILDER! [modified] Pin
PIEBALDconsult1-Nov-10 17:49
mvePIEBALDconsult1-Nov-10 17:49 
GeneralRe: ALWAYS USE A STRINGBUILDER! Pin
fjdiewornncalwe2-Nov-10 1:30
professionalfjdiewornncalwe2-Nov-10 1:30 
GeneralRe: ALWAYS USE A STRINGBUILDER! PinPopular
Samuel Cragg2-Nov-10 2:21
Samuel Cragg2-Nov-10 2:21 

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.