lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Mon, Dec 17, 2012 at 9:08 AM, Coda Highland <chighland@gmail.com> wrote:
> TL;DR: Don't bash on the "Java"-style properties; they're not bad.

Well, when we have to spell them out as setEnabled() and getEnabled()
they get pretty tedious.

I like property sugar for getters/setters (e.g. as in C#) because you
may start out exposing a field directly, and end up implementing an
explicit setter, all without messing with the public API.

Also, such properties often fall into families - a whole bunch of them
basically involve setting some private field and calling update() or
something like that.

But (since self-documenting is never as sufficient as it seems at
first) you do need to establish a documentation style for properties.

steve d.