lua-users home
lua-l archive

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


On Tue, Mar 9, 2010 at 8:45 PM, spir <denis.spir@gmail.com> wrote:
> FWIW: I found this convention fully self-understanding in your code samples.

It's true that Hungarian has gone out of fashion and never was part of
the dynamic scene, but naming function _arguments_ in a clear
conventional way does make life easier for the user who has to
understand that function.

function fun(sName,nAge,lChildren)

where s means 'string', n means 'number', l means 'list' (in the sense
of an array-like table). And so forth.

>From that, you can pretty much generate good initial LuaDocs stubs ;)

Using explicitly named types wherever possible is also helpful:

http://lua-users.org/lists/lua-l/2009-08/msg00142.html

And then, if our named 'struct' was Fred, then aFred makes perfect sense.

steve d.