Click here to Skip to main content
15,921,716 members
Home / Discussions / C#
   

C#

 
QuestionDataGrid row value Pin
webhay24-Nov-05 8:35
webhay24-Nov-05 8:35 
AnswerRe: DataGrid row value Pin
Stanciu Vlad24-Nov-05 9:01
Stanciu Vlad24-Nov-05 9:01 
GeneralRe: DataGrid row value Pin
webhay24-Nov-05 9:24
webhay24-Nov-05 9:24 
GeneralRe: DataGrid row value Pin
Stanciu Vlad24-Nov-05 9:29
Stanciu Vlad24-Nov-05 9:29 
QuestionFormatting Console.WriteLine Pin
budidharma24-Nov-05 8:03
budidharma24-Nov-05 8:03 
AnswerRe: Formatting Console.WriteLine Pin
Curtis Schlak.24-Nov-05 13:57
Curtis Schlak.24-Nov-05 13:57 
QuestionCode & Compiler Efficiency Pin
Andrew day24-Nov-05 7:28
Andrew day24-Nov-05 7:28 
AnswerRe: Code & Compiler Efficiency Pin
Colin Angus Mackay24-Nov-05 8:03
Colin Angus Mackay24-Nov-05 8:03 
They are different, not because of the way that you've written them, but because the logic is different.

The first example, in pseudo code, says
IF PAGE IS NOT POSTBACK

While the second example, in pseudo code, says
IF PAGE IS POSTBACK

I wrote a wee program that tested both in release mode to see what the generated IL was:
if (isBlah)
{
	Console.Write("It is Blah");
}
became:
// Code Size: 14 byte(s)
.maxstack 1
L_0000: ldarg.0 
L_0001: brfalse.s L_000d
L_0003: ldstr "It is Blah"
L_0008: call void [mscorlib]System.Console::Write(string)
L_000d: ret

And
if (isBlah == true)
{
	Console.Write("It is Blah");
}
became:
// Code Size: 14 byte(s)
.maxstack 1
L_0000: ldarg.0 
L_0001: brfalse.s L_000d
L_0003: ldstr "It is Blah"
L_0008: call void [mscorlib]System.Console::Write(string)
L_000d: ret


So, you can see they are exactly the same thing. Which ever that you use is entirely up to you. What ever you feel more comfortable with the compiler will still turn it in to the same code.

Does this help?


My: Blog | Photos

"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious


AnswerRe: Code & Compiler Efficiency Pin
Colin Angus Mackay24-Nov-05 8:29
Colin Angus Mackay24-Nov-05 8:29 
AnswerRe: Code & Compiler Efficiency Pin
leppie24-Nov-05 20:16
leppie24-Nov-05 20:16 
QuestionHashTable Beginning Question Pin
budidharma24-Nov-05 7:27
budidharma24-Nov-05 7:27 
AnswerRe: HashTable Beginning Question Pin
budidharma24-Nov-05 7:40
budidharma24-Nov-05 7:40 
GeneralRe: HashTable Beginning Question Pin
budidharma24-Nov-05 7:45
budidharma24-Nov-05 7:45 
Questionaccess controls in form1 from form2 Pin
Sam 200624-Nov-05 6:52
Sam 200624-Nov-05 6:52 
AnswerRe: access controls in form1 from form2 Pin
Robert Rohde24-Nov-05 7:08
Robert Rohde24-Nov-05 7:08 
GeneralRe: access controls in form1 from form2 Pin
Sam 200624-Nov-05 7:34
Sam 200624-Nov-05 7:34 
AnswerRe: access controls in form1 from form2 Pin
Curtis Schlak.24-Nov-05 14:16
Curtis Schlak.24-Nov-05 14:16 
GeneralRe: access controls in form1 from form2 Pin
Sam 200624-Nov-05 17:36
Sam 200624-Nov-05 17:36 
QuestionReflection, Breakpoints and Debug Mode Assembllies Pin
Tristan Rhodes24-Nov-05 5:58
Tristan Rhodes24-Nov-05 5:58 
AnswerRe: Reflection, Breakpoints and Debug Mode Assembllies Pin
leppie24-Nov-05 11:00
leppie24-Nov-05 11:00 
QuestionProblem with events Pin
sciamachy24-Nov-05 5:48
sciamachy24-Nov-05 5:48 
AnswerRe: Problem with events Pin
Leslie Sanford24-Nov-05 6:58
Leslie Sanford24-Nov-05 6:58 
QuestionTreeView question. Pin
zaboboa24-Nov-05 4:26
zaboboa24-Nov-05 4:26 
AnswerRe: TreeView question. Pin
Robert Rohde24-Nov-05 4:39
Robert Rohde24-Nov-05 4:39 
QuestionMethod parameters Pin
1nsp1r3d24-Nov-05 3:15
1nsp1r3d24-Nov-05 3:15 

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.