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: May be bad code or May not be!!! Pin
agolddog13-May-11 4:02
agolddog13-May-11 4:02 
GeneralRe: May be bad code or May not be!!! Pin
gumi_r@msn.com12-May-11 3:00
gumi_r@msn.com12-May-11 3:00 
GeneralRe: May be bad code or May not be!!! Pin
musefan12-May-11 3:06
musefan12-May-11 3:06 
GeneralRe: May be bad code or May not be!!! Pin
RobCroll12-May-11 3:40
RobCroll12-May-11 3:40 
GeneralRe: May be bad code or May not be!!! Pin
Ravi Sant12-May-11 19:05
Ravi Sant12-May-11 19:05 
GeneralRe: May be bad code or May not be!!! Pin
Richard Deeming13-May-11 2:35
mveRichard Deeming13-May-11 2:35 
GeneralRe: May be bad code or May not be!!! Pin
Ravi Sant13-May-11 3:33
Ravi Sant13-May-11 3:33 
GeneralRe: May be bad code or May not be!!! Pin
Luc Pattyn12-May-11 4:16
sitebuilderLuc Pattyn12-May-11 4:16 
You didn't tell us what types A, B, C are.

They could be some type with the == operator overloaded by something counter-intuitive. They could also be just stupid integers, stored globally, marked volatile, and changing occasionally...

So, yes it looks weird, it probably is a mistake, and OTOH it could function as intended and just be a case of bad, hardly readable, code.

Smile | :)
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.

GeneralRe: May be bad code or May not be!!! Pin
Ravi Sant12-May-11 19:03
Ravi Sant12-May-11 19:03 
GeneralRe: May be bad code or May not be!!! Pin
mahendren12-May-11 20:25
mahendren12-May-11 20:25 
GeneralRe: May be bad code or May not be!!! Pin
Ravi Sant12-May-11 20:28
Ravi Sant12-May-11 20:28 
GeneralRe: May be bad code or May not be!!! Pin
Narf the Mouse12-May-11 19:02
Narf the Mouse12-May-11 19:02 
GeneralRe: May be bad code or May not be!!! Pin
R. Erasmus12-May-11 21:06
R. Erasmus12-May-11 21:06 
GeneralRe: May be bad code or May not be!!! Pin
Ravi Sant12-May-11 21:07
Ravi Sant12-May-11 21:07 
GeneralRe: May be bad code or May not be!!! Pin
R. Erasmus12-May-11 21:09
R. Erasmus12-May-11 21:09 
GeneralRe: May be bad code or May not be!!! Pin
Ravi Sant12-May-11 21:19
Ravi Sant12-May-11 21:19 
JokeRe: May be bad code or May not be!!! Pin
DragonsRightWing13-May-11 7:56
DragonsRightWing13-May-11 7:56 
GeneralRe: May be bad code or May not be!!! PinPopular
Stefan_Lang12-May-11 21:57
Stefan_Lang12-May-11 21:57 
GeneralRe: May be bad code or May not be!!! Pin
Ravi Sant12-May-11 21:58
Ravi Sant12-May-11 21:58 
GeneralRe: May be bad code or May not be!!! Pin
whiteclouds12-May-11 22:08
whiteclouds12-May-11 22:08 
GeneralRe: May be bad code or May not be!!! Pin
Kent K13-May-11 3:39
professionalKent K13-May-11 3:39 
GeneralRe: May be bad code or May not be!!! Pin
frattaro13-May-11 5:11
frattaro13-May-11 5:11 
GeneralPlease laugh at me so I never do this again... Pin
henrikqwerty32112-May-11 0:34
henrikqwerty32112-May-11 0:34 
GeneralRe: Please laugh at me so I never do this again... Pin
JP_Rocks12-May-11 0:45
JP_Rocks12-May-11 0:45 
GeneralRe: Please laugh at me so I never do this again... PinPopular
henrikqwerty32112-May-11 0:54
henrikqwerty32112-May-11 0:54 

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.