2 ms·
I have sometimes wondered why none of the mainstream OO languages implemented an access class of publicly readable but only privately modifiable.
by mannykannot 9y ago
I have sometimes wondered why none of the mainstream OO languages implemented an access class of publicly readable but only privately modifiable.
- akmarinov 9y agoDoes Swift count? private(set) is a thing
- mannykannot 9y agoSure, Swift counts - thanks for the correction. Maybe those with experience of it could comment on whether they found this feature useful in practice.
- hardwaresofton 9y agoSome do -- for example in C# you can do: public int member { get; private set; } That said, C# is very much my kryptonite and I hate it, so don't ask me any further questions.