naming convention

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

naming convention

fschmidt
Administrator
Which do you prefer?

getmetatable  -- Lua
getMetatable  -- Java
get_metatable  -- Python
Woe to those who call bad good and good bad -- Isaiah 5:20
Following the Old Testament, not evil modern culture
Reply | Threaded
Open this post in threaded view
|

Re: naming convention

Hugo <Nabble>
I am more used to the java style, but the Lua style also works for me. Since Luan is about Lua, not java, maybe we should follow Lua in this case.
Reply | Threaded
Open this post in threaded view
|

Re: naming convention

fschmidt
Administrator
I prefer the Python style which is also NAML style.  Another example (from NAML):

viewstandardpage
viewStandardPage
view_standard_page
Woe to those who call bad good and good bad -- Isaiah 5:20
Following the Old Testament, not evil modern culture
Reply | Threaded
Open this post in threaded view
|

Re: naming convention

Hugo <Nabble>
If this convention applies only to code that we create to build the sites, than the naml convention works for me. Lua methods and functions should follow the Lua standard.
Reply | Threaded
Open this post in threaded view
|

Re: naming convention

fschmidt
Administrator
Since our users will use Lua methods, these users will then be forced to deal with inconsistent conventions.  Note that I cannot implement all standard Lua methods anyway, for example I can't implement the next() method.  And for users who want standard method names, it is trivial to add like this:

getmetatable  = get_metatable
setmetatable  = set_metatable
Woe to those who call bad good and good bad -- Isaiah 5:20
Following the Old Testament, not evil modern culture
Reply | Threaded
Open this post in threaded view
|

Re: naming convention

Hugo <Nabble>
Okay, I think this could work, so you can go ahead. I will only be 100% sure when I start working heavily with this code.
Reply | Threaded
Open this post in threaded view
|

Re: naming convention

fschmidt
Administrator
ok, closing thread
Woe to those who call bad good and good bad -- Isaiah 5:20
Following the Old Testament, not evil modern culture