lua-users home
lua-l archive

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


On 2014-04-26 3:51 PM, "Tom N Harris" <telliamed@whoopdedo.org> wrote:
> I've sometimes wondered about the "predicate?" style of naming if Spanish
> speakers wish they could type "¿predicate?" instead.
>
One thing I've always been curious about is if some design patterns would be more popular in languages which are not developed by English speakers. E.g. Latin with its many verb forms, or Japanese with its subject-object-verb order (which looks a lot like postfix notation vs English's infix).

> > [1] and everyone agrees that tautological documentation ("add(x,y):
> > adds x and y") is worse than none at all.  JavaDoc made this style
> > popular.
>
> I've seen this said a few times. But no one has ever explained how you
> *should* document the "add" function. Other than stating the expected types of
> the arguments which your example leaves out. But how would you document
> "function isnil(value) return value == nil end" in a non-tautological way?
>
I don't think it's necessary to write an explanation for these at all. Their name and signature should be sufficient. Types shouldn't matter either: in a strongly typed language, the signature lists them already, and in a weakly typed language, it should be assumed that it will just attempt to add any values you give it and throw an error if that's not possible.

My question would rather be why these functions exist... :-)