2 ms·
At least in C# terminology, a "setter" for a public property is mediated access, unmediated access would be a public field that can be set without invoking a se
by DougBTX 9y ago
At least in C# terminology, a "setter" for a public property is mediated access, unmediated access would be a public field that can be set without invoking a setter method.
Getters and setters in C# are method calls, like `setFoo` in Java, so can't be assumed to be simple, they can do anything any other method can do.
- noblethrasher 9y agoAs it turns out, C# is a language that I know extremely well; I'm aware that setters can have arbitrary code. But, here's the problem: A programming a language is medium for thought, which means that it promotes or prevents the occurrence of certain ideas. So, even though the compiler will accept any legal void-returning code within the inner braces of public Foo Bar { set { //Do stuff } } The fact that the client code is going to look like `Obj.Foo = whatever` will practically foreclose on all but a small subset of possibilities.