Andrei Alexandrescu wrote:
Nick Sabalausky wrote:
"Andrei Alexandrescu" <[email protected]> wrote in message
news:[email protected]...
But what I want is to come with a new design that adds minimum
aggravation on the learning programmer. If they know how to define a
method, they must know how to define a property. None of that
property blah { get ... set ... } crap is necessary.
I can't be nice about this: Any programmer who has *any* aggrivation
learning any even remotely sane property syntax is an idiot, period.
They'd have to be incompetent to not be able to look at an example
like this:
// Fine, I'll throw DRY away:
int _width;
int width
{
get { return _width; }
set(v) { _width = v; }
}
And immediately know exactly how the poroperty syntax works.
Sure. My point is that with using standard method definition syntax
there's no need for even looking over an example.
PLUS:
* need to remember that get is not followed by ()
* need to remember that set does not take a type like any other
function, just an identifier
* need to remember that there is no () after width
WHY? Do you have just one reason for which all this is necessary?
Andrei