Tuesday, February 24, 2004 10:08 AM
richard
C#: Passing parameters by reference or by value
I wrote a question on how parameter passing works for our candidate exam (any applicant lucky enough to read my blog will now get a free answer, I guess!) on ASP.NET / C# etc. Since my coworkers and I have been discussing this topic over the last few days I thought I'd post about it (why else?).
Wonder-twin powers activate! Form of: Sarcastic Bastard
Essentially I fell in with the dangerous microsoft.public.dotnet.languages.csharp elitist crowd and so became a 'pedantic parameter bigot'. We like to roam cyber, Cartesian and other high and low-dimensional spaces vilifying those 'parameter dilettantes' who dare say that reference type variables are passed by reference. Indeed!
But in reality many people I greatly respect in real and cyber spaces use the terms that way and I can only conclude that it is my inflexibility and not any failing of theirs that causes this problem of communication. Certainly I would want people to tolerate the somewhat vague things I often prattle on about and not call me on every slightly ambiguous thing I say. I can only ask this: read the links below and come to your own conclusions about how you want to phrase it:
Jon Skeet's Parameter passing in C#
Microsoft's 'Passing Parameters' C# Reference