lua-users home
lua-l archive

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


David and I have worked on the new LSP plugin for our web-server and we have been discussing the variable naming convention for some time. I would like to have a dialog with this group as to what is the best naming convention.

We recently added the server to the list of Lua projects:
http://www.lua.org/uses.html#248

Currently, LSP provides support for the Barracuda API using the same names as on the C side, but with a different naming convention.

C side:
---------------------

We differentiate between classes and instances on the C side since C is a typed language. A class always starts with an uppercase, such as HttpRequest. An instance variable always starts with a lowercase, such as request.

A method name always starts with lowercase, such as request:sleep

Multiple-word identifiers start with a lowercase and the word boundaries are uppercase.
Example: twoWords


Lua side:
--------------------

Currently, everything on the Lua side is lowercase, including multiple-word boundaries.
Example: request:encoderedirecturl

We are debating on changing the convention to the same as the "instance" convention on the C side. As an example, the above method name would be: request:encodeRedirectUrl

Ref:
http://barracudaserver.com/doc/Lua/
http://en.wikipedia.org/wiki/Identifier_naming_convention

Thanks,
Wilfred