Click here to Skip to main content
15,915,508 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.

 
GeneralRe: Naming stuff... Pin
Overtkill13-Aug-19 6:20
Overtkill13-Aug-19 6:20 
GeneralRe: Naming stuff... Pin
honey the codewitch12-Aug-19 19:46
mvahoney the codewitch12-Aug-19 19:46 
GeneralRe: Naming stuff... Pin
kmoorevs12-Aug-19 9:51
kmoorevs12-Aug-19 9:51 
GeneralRe: Naming stuff... Pin
Sander Rossel12-Aug-19 10:33
professionalSander Rossel12-Aug-19 10:33 
GeneralRe: Naming stuff... Pin
honey the codewitch12-Aug-19 19:43
mvahoney the codewitch12-Aug-19 19:43 
GeneralRe: Naming stuff... Pin
Sander Rossel12-Aug-19 21:55
professionalSander Rossel12-Aug-19 21:55 
GeneralRe: Naming stuff... Pin
honey the codewitch12-Aug-19 21:58
mvahoney the codewitch12-Aug-19 21:58 
GeneralRe: Naming stuff... Pin
Sander Rossel12-Aug-19 22:28
professionalSander Rossel12-Aug-19 22:28 
Works fine in both C# and IL.
C#
public class Whatever
    private readonly string someValue;

    public Whatever(string someValue)
    {
        this.someValue = someValue;
    }
}
ILDASM gives the following members (or whatever they are):
.class public auto ansi beforefieldinit
someValue : private initonly string
.ctor : void(string)

IL of ctor:
.method public hidebysig specialname rtspecialname 
        instance void  .ctor(string someValue) cil managed
{
  // Code size       16 (0x10)
  .maxstack  8
  IL_0000:  ldarg.0
  IL_0001:  call       instance void [System.Runtime]System.Object::.ctor()
  IL_0006:  nop
  IL_0007:  nop
  IL_0008:  ldarg.0
  IL_0009:  ldarg.1
  IL_000a:  stfld      string ConsoleApp1.Whatever::someValue
  IL_000f:  ret
} // end of method Whatever::.ctor
this.someValue is just different from someValue and by using the full namespace or whatever they can easily be kept apart Smile | :)
Just like you can have the same class name in multiple namespaces Smile | :)

GeneralRe: Naming stuff... Pin
honey the codewitch12-Aug-19 22:58
mvahoney the codewitch12-Aug-19 22:58 
GeneralRe: Naming stuff... Pin
Sander Rossel12-Aug-19 23:06
professionalSander Rossel12-Aug-19 23:06 
GeneralRe: Naming stuff... Pin
honey the codewitch12-Aug-19 23:36
mvahoney the codewitch12-Aug-19 23:36 
GeneralRe: Naming stuff... Pin
Sander Rossel13-Aug-19 0:19
professionalSander Rossel13-Aug-19 0:19 
GeneralRe: Naming stuff... Pin
sasadler13-Aug-19 5:49
sasadler13-Aug-19 5:49 
GeneralRe: Naming stuff... Pin
honey the codewitch12-Aug-19 19:40
mvahoney the codewitch12-Aug-19 19:40 
GeneralRe: Naming stuff... Pin
Member 916705712-Aug-19 21:15
Member 916705712-Aug-19 21:15 
GeneralRe: Naming stuff... Pin
Sander Rossel12-Aug-19 22:04
professionalSander Rossel12-Aug-19 22:04 
GeneralRe: Naming stuff... Pin
Member 916705712-Aug-19 22:15
Member 916705712-Aug-19 22:15 
GeneralRe: Naming stuff... Pin
Sander Rossel12-Aug-19 22:47
professionalSander Rossel12-Aug-19 22:47 
GeneralRe: Naming stuff... Pin
Member 916705712-Aug-19 23:23
Member 916705712-Aug-19 23:23 
GeneralRe: Naming stuff... Pin
Sander Rossel13-Aug-19 0:02
professionalSander Rossel13-Aug-19 0:02 
GeneralRe: Naming stuff... Pin
Member 916705713-Aug-19 0:34
Member 916705713-Aug-19 0:34 
GeneralRe: Naming stuff... Pin
Sander Rossel13-Aug-19 10:26
professionalSander Rossel13-Aug-19 10:26 
GeneralRe: Naming stuff... Pin
Member 916705714-Aug-19 3:18
Member 916705714-Aug-19 3:18 
GeneralRe: Naming stuff... Pin
Sander Rossel14-Aug-19 3:26
professionalSander Rossel14-Aug-19 3:26 
GeneralRe: Naming stuff... Pin
Member 916705714-Aug-19 3:30
Member 916705714-Aug-19 3: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.