Click here to Skip to main content
15,905,607 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: Step Right Up, Get Yer Session 'ere Pin
Luc Pattyn20-May-11 9:17
sitebuilderLuc Pattyn20-May-11 9:17 
GeneralRe: Step Right Up, Get Yer Session 'ere Pin
AspDotNetDev20-May-11 9:23
protectorAspDotNetDev20-May-11 9:23 
GeneralRe: Step Right Up, Get Yer Session 'ere [modified] Pin
BillW3322-May-11 15:12
professionalBillW3322-May-11 15:12 
GeneralRe: Step Right Up, Get Yer Session 'ere Pin
Rob Grainger1-Jun-11 23:01
Rob Grainger1-Jun-11 23:01 
GeneralRe: Step Right Up, Get Yer Session 'ere Pin
meaningoflights25-May-11 13:43
meaningoflights25-May-11 13:43 
GeneralJavascript sleep Pin
Andy Brummer18-May-11 10:41
sitebuilderAndy Brummer18-May-11 10:41 
JokeRe: Javascript sleep Pin
Peter_in_278018-May-11 21:29
professionalPeter_in_278018-May-11 21:29 
GeneralRe: Javascript sleep Pin
Jeroen De Dauw23-May-11 7:54
Jeroen De Dauw23-May-11 7:54 
GeneralRe: Javascript sleep Pin
Peter_in_278023-May-11 14:16
professionalPeter_in_278023-May-11 14:16 
GeneralRe: Javascript sleep Pin
Jeroen De Dauw23-May-11 14:20
Jeroen De Dauw23-May-11 14:20 
GeneralLogic Pin
Fabio V Silva17-May-11 5:07
Fabio V Silva17-May-11 5:07 
GeneralRe: Logic Pin
Shameel17-May-11 5:24
professionalShameel17-May-11 5:24 
GeneralRe: Logic Pin
Fabio V Silva17-May-11 5:28
Fabio V Silva17-May-11 5:28 
GeneralRe: Logic Pin
Shameel17-May-11 7:43
professionalShameel17-May-11 7:43 
GeneralRe: Logic Pin
Fabio V Silva17-May-11 7:47
Fabio V Silva17-May-11 7:47 
GeneralRe: Logic Pin
Shameel17-May-11 7:50
professionalShameel17-May-11 7:50 
GeneralRe: Logic Pin
Fabio V Silva17-May-11 7:58
Fabio V Silva17-May-11 7:58 
GeneralRe: Logic Pin
Shameel17-May-11 7:59
professionalShameel17-May-11 7:59 
GeneralRe: Logic Pin
Fabio V Silva17-May-11 8:03
Fabio V Silva17-May-11 8:03 
GeneralRe: Logic Pin
Shameel17-May-11 8:06
professionalShameel17-May-11 8:06 
GeneralRe: Logic Pin
Fabio V Silva17-May-11 8:10
Fabio V Silva17-May-11 8:10 
GeneralRe: Logic Pin
Shameel17-May-11 8:16
professionalShameel17-May-11 8:16 
GeneralRe: Logic Pin
Fabio V Silva17-May-11 8:30
Fabio V Silva17-May-11 8:30 
What you don't seem to realise is that I'm not talking about the operators names but what they do.
From MSDN[^]:
& - logical AND
| - logical OR
&& - conditional AND
|| - conditional OR

From MSDN[^]:
The operation
x && y
corresponds to the operation
x & y
except that if x is false, y is not evaluated (because the result of the AND operation is false no matter what the value of y may be). This is known as "short-circuit" evaluation.

Which means I was right in my first post to say there was no difference, in that if condition, to use one or the other, the program still runs with no exceptions and as expected.

Your only argument so far is that one is called logical and the other bitwise which doesn't change the fact that I was right; call them what you want.
GeneralRe: Logic Pin
Shameel17-May-11 8:44
professionalShameel17-May-11 8:44 
GeneralRe: Logic Pin
Fabio V Silva17-May-11 8:47
Fabio V Silva17-May-11 8:47 

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.