Click here to Skip to main content
15,891,904 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
JokeDear Mr Hankey Pin
Rajesh R Subramanian1-Dec-16 14:27
professionalRajesh R Subramanian1-Dec-16 14:27 
GeneralBig bad bug in .NET... Pin
Sander Rossel1-Dec-16 6:17
professionalSander Rossel1-Dec-16 6:17 
GeneralRe: Big bad bug in .NET... Pin
Kevin Marois1-Dec-16 6:30
professionalKevin Marois1-Dec-16 6:30 
GeneralRe: Big bad bug in .NET... Pin
Sander Rossel1-Dec-16 8:09
professionalSander Rossel1-Dec-16 8:09 
GeneralRe: Big bad bug in .NET... Pin
#realJSOP1-Dec-16 6:37
mve#realJSOP1-Dec-16 6:37 
GeneralRe: Big bad bug in .NET... Pin
Sander Rossel1-Dec-16 8:11
professionalSander Rossel1-Dec-16 8:11 
GeneralRe: Big bad bug in .NET... Pin
Richard Deeming1-Dec-16 11:13
mveRichard Deeming1-Dec-16 11:13 
GeneralRe: Big bad bug in .NET... Pin
Matt T Heffron2-Dec-16 12:11
professionalMatt T Heffron2-Dec-16 12:11 
However, passing them in an order that is different from the unnamed, normal, order does use more stack space!
C#
public void Main()
{
  Foo(1, 2);
  Foo(x: 1, y: 2);
  Foo(y: 1, x: 2);
}

void Foo(int x, int y) { }

IL:
IL_0000: ldarg.0
IL_0001: ldc.i4.1
IL_0002: ldc.i4.2
IL_0003: call instance void Foo(int32, int32)
IL_0008: ldarg.0
IL_0009: ldc.i4.1
IL_000a: ldc.i4.2
IL_000b: call instance void Foo(int32, int32)
IL_0010: ldarg.0
IL_0011: ldc.i4.1
IL_0012: stloc.0
IL_0013: ldc.i4.2
IL_0014: ldloc.0
IL_0015: call instance void Foo(int32, int32)
IL_001a: ret

It must do this because the passed arguments are evaluated in left-to-right order of the call, not the order that the called method expects.
(Section 7.5.1.2 of "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC#\Specifications\1033\CSharp Language Specification.docx" as installed with VS2013.)
"Fairy tales do not tell children the dragons exist. Children already know that dragons exist. Fairy tales tell children the dragons can be killed."
- G.K. Chesterton

GeneralRe: Big bad bug in .NET... Pin
OriginalGriff1-Dec-16 8:33
mveOriginalGriff1-Dec-16 8:33 
GeneralRe: Big bad bug in .NET... Pin
Jon McKee1-Dec-16 9:45
professionalJon McKee1-Dec-16 9:45 
GeneralRe: Big bad bug in .NET... Pin
dandy721-Dec-16 11:00
dandy721-Dec-16 11:00 
GeneralRe: Big bad bug in .NET... Pin
Sander Rossel1-Dec-16 21:16
professionalSander Rossel1-Dec-16 21:16 
GeneralRe: Big bad bug in .NET... Pin
dandy722-Dec-16 3:40
dandy722-Dec-16 3:40 
GeneralRe: Big bad bug in .NET... Pin
Richard Deeming1-Dec-16 11:22
mveRichard Deeming1-Dec-16 11:22 
GeneralRe: Big bad bug in .NET... Pin
Sander Rossel1-Dec-16 21:11
professionalSander Rossel1-Dec-16 21:11 
GeneralThought of the day Pin
OriginalGriff1-Dec-16 4:51
mveOriginalGriff1-Dec-16 4:51 
GeneralRe: Thought of the day Pin
lopatir1-Dec-16 4:56
lopatir1-Dec-16 4:56 
GeneralRe: Thought of the day Pin
Richard Deeming1-Dec-16 4:58
mveRichard Deeming1-Dec-16 4:58 
GeneralRe: Thought of the day Pin
W Balboos, GHB1-Dec-16 5:02
W Balboos, GHB1-Dec-16 5:02 
GeneralRe: Thought of the day Pin
Daniel Pfeffer1-Dec-16 5:07
professionalDaniel Pfeffer1-Dec-16 5:07 
GeneralRe: Thought of the day Pin
den2k881-Dec-16 5:18
professionalden2k881-Dec-16 5:18 
GeneralRe: Thought of the day Pin
Joe Woodbury1-Dec-16 5:26
professionalJoe Woodbury1-Dec-16 5:26 
GeneralRe: Thought of the day Pin
lopatir1-Dec-16 5:30
lopatir1-Dec-16 5:30 
GeneralRe: Thought of the day Pin
Joe Woodbury1-Dec-16 5:32
professionalJoe Woodbury1-Dec-16 5:32 
GeneralRe: Thought of the day Pin
OriginalGriff1-Dec-16 5:49
mveOriginalGriff1-Dec-16 5:49 

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.