25-Jan-2013 23:27, Nick Sabalausky пишет:
On Thu, 24 Jan 2013 23:36:30 +0400
Dmitry Olshansky <dmitry.o...@gmail.com> wrote:
These days properties imply an action of, well, obtaining said value.
If it's a wrapper as in "return zis variable" something is wrong
already.
I agree in principle, but unfortunately "return zis variable" getters
are often needed because no major language (that I know of) offers any
other way to create data that's privately-writable and
publicly-read-only - a very common need.
Ie, that's the "something" that "is wrong already": the lack of a
simple built-in "The public can only read this, but I can R/W it." to
obviate an extremely common idiom.
It might be worth extending the access modifiers (not going to happen)
or maybe simplifying the boilerplate... (could happen but dunno).
--
Dmitry Olshansky