[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Defining APIs, best practices.
- From: steve donovan <steve.j.donovan@...>
- Date: Mon, 17 Dec 2012 09:15:47 +0200
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.
- References:
- Defining APIs, best practices., Jorge
- RE: Defining APIs, best practices., Thijs Schreijer
- Re: Defining APIs, best practices., Jorge
- Re: Defining APIs, best practices., Javier Guerra Giraldez
- Re: Defining APIs, best practices., Coda Highland
- Re: Defining APIs, best practices., Javier Guerra Giraldez
- Re: Defining APIs, best practices., Rena
- Re: Defining APIs, best practices., Andrew Starks
- Re: Defining APIs, best practices., Coda Highland
- Re: Defining APIs, best practices., Jorge Visca
- Re: Defining APIs, best practices., Coda Highland
- Re: Defining APIs, best practices., Dirk Laurie
- Re: Defining APIs, best practices., Coda Highland