lua-users home
lua-l archive

Re: Defining APIs, best practices.

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


2012年12月16日 Coda Highland <chighland@gmail.com>:
>
>> I interpret setEnabled() as "set as enabled", while being the same as
>> setEnabled(nil).
>
> Ah, and that's where we differ -- I read "setEnabled(" as "set the
> enabled property to", and thereby get an incomplete sentence if there
> isn't a parameter inside.
>
That's why one should not have hundreds of tiny routines with names
like that. `option{Enabled=true}` is unambiguous, extensible and uses
up only one name. PiL 5.3.
I've never been able to understand why people are willing to swallow
great gulps of pseudo-Java in order to avoid creating one table. Even
a well-respected member of the Lua community, in another thread,
recoiled in horror at the construction `{...}`.

AltStyle によって変換されたページ (->オリジナル) /