@property usage

ketmar via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Dec 4 03:57:25 PST 2014


On Thu, 04 Dec 2014 10:21:10 +0000
uri via Digitalmars-d-learn <digitalmars-d-learn at puremagic.com> wrote:

> Do you guys use @property much, or is it largely ignored/avoided?
i'm using it alot for the things that looks like properties. ;-)

the thing is looking like a property if it works almost as fast as
accesing the field directly. i.e. does simple check or two, but doesn't
calculate something heavy. that means that `area` for Rect is
definitely a property, but `equalElementCount` for a single-linked list
is not.

i also using that alot to simulate read-only fields.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20141204/4a1eb69e/attachment.sig>


More information about the Digitalmars-d-learn mailing list