True Properties Poll

Nick Sabalausky a at a.a
Fri Jul 31 13:05:51 PDT 2009


"Jesse Phillips" <jessekphillips+d at gmail.com> wrote in message 
news:h4vg5q$13mn$1 at digitalmars.com...
>
> I find writing
>
> property int foo { get; set;}
>
> More work than
>
> public int foo;

That's an unfair apples-to-oranges comparison.

This:

property int foo { get; set;}

Is comparable to this current code:

private int _foo;
int foo()
{
    return _foo;
}
int foo(int value)
{
    _foo = value;
    return value;
}

It is *not* comparable to:

public int foo;






More information about the Digitalmars-d mailing list