Click here to Skip to main content
15,886,873 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: Logic Pin
Manfred Rudolf Bihy20-May-11 4:38
professionalManfred Rudolf Bihy20-May-11 4:38 
GeneralRe: Logic Pin
OriginalGriff20-May-11 4:43
mveOriginalGriff20-May-11 4:43 
GeneralRe: Logic Pin
BobJanova20-May-11 4:46
BobJanova20-May-11 4:46 
GeneralRe: Logic Pin
Shameel25-May-11 8:31
professionalShameel25-May-11 8:31 
GeneralRe: Logic Pin
Nagy Vilmos20-May-11 5:13
professionalNagy Vilmos20-May-11 5:13 
GeneralRe: Logic Pin
sucram23-May-11 2:51
sucram23-May-11 2:51 
GeneralRe: Logic Pin
Timothy Byrd23-May-11 16:25
Timothy Byrd23-May-11 16:25 
GeneralRe: Logic Pin
Rob Grainger23-May-11 23:56
Rob Grainger23-May-11 23:56 
And quite rightly so.

While for booleans, & can work as a logical operator, in all other cases it is bitwise. For consistency, use a single operatopr to represent logical operators throughout, the C# designers (C really) chose && for this purpose.

It may work, but its obfuscated, and should be rejected or corrected by any reasonable code review, regardless of any appeals you make to technical documentation.
GeneralRe: Logic Pin
Timothy Byrd24-May-11 9:09
Timothy Byrd24-May-11 9:09 
JokeRe: Logic Pin
Firo Atrum Ventus24-May-11 21:36
Firo Atrum Ventus24-May-11 21:36 
GeneralRe: Logic Pin
James Lonero25-May-11 11:24
James Lonero25-May-11 11:24 
JokeGlitch PinPopular
Viktor Signaievskyi13-May-11 22:01
Viktor Signaievskyi13-May-11 22:01 
GeneralRe: Glitch Pin
walterhevedeich15-May-11 14:35
professionalwalterhevedeich15-May-11 14:35 
GeneralRe: Glitch Pin
Viktor Signaievskyi17-May-11 8:42
Viktor Signaievskyi17-May-11 8:42 
GeneralRe: Glitch Pin
walterhevedeich17-May-11 14:53
professionalwalterhevedeich17-May-11 14:53 
GeneralRe: Glitch Pin
Viktor Signaievskyi18-May-11 7:48
Viktor Signaievskyi18-May-11 7:48 
GeneralRe: Glitch Pin
Chris Berger16-May-11 5:19
Chris Berger16-May-11 5:19 
GeneralRe: Glitch Pin
saxenaabhi616-May-11 20:31
saxenaabhi616-May-11 20:31 
GeneralRe: Glitch Pin
Viktor Signaievskyi17-May-11 8:59
Viktor Signaievskyi17-May-11 8:59 
GeneralRe: Glitch Pin
TorstenFrings17-May-11 2:39
TorstenFrings17-May-11 2:39 
GeneralRe: Glitch Pin
Viktor Signaievskyi17-May-11 9:31
Viktor Signaievskyi17-May-11 9:31 
GeneralRe: Glitch Pin
Stefan_Lang18-May-11 6:41
Stefan_Lang18-May-11 6:41 
GeneralThere is no Spoon Pin
AspDotNetDev13-May-11 12:17
protectorAspDotNetDev13-May-11 12:17 
JokeRe: There is no Spoon Pin
StM0n13-May-11 20:36
StM0n13-May-11 20:36 
JokeRe: There is no Spoon Pin
Sander Rossel13-May-11 22:30
professionalSander Rossel13-May-11 22:30 

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.