Beginners question: Is there any disadvantage to the following solution?
public string SomeProperty { get; private set; }
as in C# public variable as writeable inside the class but readonly outside the class
Because I definetly find it nicer, than:
string someProperty;
public string SomeProperty{
get {
return someProperty;
}
}
But why can't C# have something like
GetOnly string someProperty;
which would do the same as the above? Wouldn't that be much easier to read and write?