Click here to Skip to main content
15,886,518 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: Straight from the horse's mouth PinPopular
Peter_in_278012-Feb-12 19:18
professionalPeter_in_278012-Feb-12 19:18 
GeneralRe: Straight from the horse's mouth Pin
Bernhard Hiller12-Feb-12 21:41
Bernhard Hiller12-Feb-12 21:41 
GeneralRe: Straight from the horse's mouth Pin
CDP180212-Feb-12 22:07
CDP180212-Feb-12 22:07 
GeneralRe: Straight from the horse's mouth Pin
BobJanova12-Feb-12 23:05
BobJanova12-Feb-12 23:05 
GeneralRe: Straight from the horse's mouth PinPopular
CDP180213-Feb-12 0:03
CDP180213-Feb-12 0:03 
GeneralRe: Straight from the horse's mouth Pin
BobJanova13-Feb-12 3:45
BobJanova13-Feb-12 3:45 
GeneralRe: Straight from the horse's mouth Pin
Rob Grainger13-Feb-12 4:35
Rob Grainger13-Feb-12 4:35 
GeneralRe: Straight from the horse's mouth Pin
Frank Peelo14-Feb-12 0:49
Frank Peelo14-Feb-12 0:49 
"if you used some kind of definitions for boolean values, you had to 'translate' your results in similar ways as shown here."

Not true! In C[1], the expression is false if it's 0, true otherwise. You NEVER compare to a specific non-false value. You can use a definition for a non-false value, as a "sample" true to return from functions or to set variables, but it is very bad practise to compare anything to that value. This construct may be harmless enough in C#, but a C programmer who used this construct should be larted. Hard. Otherwise he'll start comparing things to whatever value the identifier "true" value, and end up with bugs because in C "true" is just not unique!

[1] I don't use C++, but it does have a boolean datatype
GeneralRe: Straight from the horse's mouth Pin
Rob Grainger13-Feb-12 4:39
Rob Grainger13-Feb-12 4:39 
GeneralRe: Straight from the horse's mouth Pin
Dan Neely13-Feb-12 17:31
Dan Neely13-Feb-12 17:31 
GeneralRe: Straight from the horse's mouth Pin
Marc Greiner at home14-Feb-12 4:58
Marc Greiner at home14-Feb-12 4:58 
GeneralRe: Straight from the horse's mouth Pin
CDP180214-Feb-12 5:36
CDP180214-Feb-12 5:36 
GeneralRe: Straight from the horse's mouth Pin
Rob Grainger14-Feb-12 8:53
Rob Grainger14-Feb-12 8:53 
GeneralRe: Straight from the horse's mouth Pin
GibbleCH13-Feb-12 6:16
GibbleCH13-Feb-12 6:16 
GeneralRe: Straight from the horse's mouth Pin
Jeremy Hutchinson14-Feb-12 1:30
professionalJeremy Hutchinson14-Feb-12 1:30 
GeneralRe: Straight from the horse's mouth Pin
Vladimir Svyatski13-Feb-12 20:21
professionalVladimir Svyatski13-Feb-12 20:21 
GeneralRe: Straight from the horse's mouth Pin
Fran Porretto14-Feb-12 1:06
Fran Porretto14-Feb-12 1:06 
GeneralRe: Straight from the horse's mouth Pin
User 483504714-Feb-12 3:13
User 483504714-Feb-12 3:13 
GeneralRe: Straight from the horse's mouth Pin
BrainiacV14-Feb-12 3:58
BrainiacV14-Feb-12 3:58 
GeneralRe: Straight from the horse's mouth Pin
Massimo Perrone14-Feb-12 5:37
Massimo Perrone14-Feb-12 5:37 
GeneralRe: Straight from the horse's mouth Pin
Zan Lynx14-Feb-12 7:00
Zan Lynx14-Feb-12 7:00 
GeneralRe: Straight from the horse's mouth Pin
AspDotNetDev14-Feb-12 7:33
protectorAspDotNetDev14-Feb-12 7:33 
GeneralRe: Straight from the horse's mouth Pin
  Forogar  14-Feb-12 7:49
professional  Forogar  14-Feb-12 7:49 
GeneralRe: Straight from the horse's mouth Pin
KP Lee14-Feb-12 12:51
KP Lee14-Feb-12 12:51 
GeneralRe: Straight from the horse's mouth Pin
Patrick Harris19-Feb-12 19:21
Patrick Harris19-Feb-12 19: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.