[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Defining APIs, best practices.
- From: Coda Highland <chighland@...>
- Date: Mon, 17 Dec 2012 08:11:48 -0800
On Mon, Dec 17, 2012 at 12:12 AM, steve donovan
<steve.j.donovan@gmail.com> wrote:
> On Mon, Dec 17, 2012 at 9:57 AM, Coda Highland <chighland@gmail.com> wrote:
>> obj:set{enabled=true}
>> Of these variations, Java-style is the shortest. :P
>
> Ah, but Dirk-style can set multiple properties in one go:
> obj:set{enabled=true,visible=true,name='Frodo'}.
I mentioned this two e-mails ago, and doing that adds additional
overhead to the setter (pairs() and a loop) and further worsens the
asymmetry between getter and setter.
>> I feel like there's got to be a good way to simplify this no matter
>> what method you're using.
>
> Thinking of upgrading Microlight's simple class mechanism to support
> properties, with as little fuss as possible.
I don't use Microlight from lack of need of it, but that sounds like a
great idea. :)
> You do know that one of the endless style wars in Java-land is
> 'getters are bad'. Because they think it's just a tedious way to
> write a struct, and structs are not classes. Fortunately we work in a
> less dogmatic language community that isn't obsessed with sniffing
> other people's code for 'code smells' ;)
I avoid Java as much as possible so I actually didn't know that. I
hail from the Qt community, where we think the C++ community at large
is a little crazy and we mostly have an implicit agreement that Qt's
API style is pretty much the best you can do in C++.
/s/ Adam
- 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
- Re: Defining APIs, best practices., steve donovan
- Re: Defining APIs, best practices., Coda Highland
- Re: Defining APIs, best practices., steve donovan