Lua Style

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Lua Style

Post by kikito »

I use two spaces. My explanation is here: viewtopic.php?f=3&t=79017&start=10#p175859 . I wrote more about tabs and spaces on that thread.

Regarding camelCasing vs under_scoring, I usually do camelCase in Lua.

Those are for my personal projects. If I am working on a team and that team has different conventions, I use those.
When I write def I mean function.
User avatar
s-ol
Party member
Posts: 1077
Joined: Mon Sep 15, 2014 7:41 pm
Location: Cologne, Germany
Contact:

Re: Lua Style

Post by s-ol »

kikito wrote:I use two spaces. My explanation is here: viewtopic.php?f=3&t=79017&start=10#p175859 . I wrote more about tabs and spaces on that thread.

Regarding camelCasing vs under_scoring, I usually do camelCase in Lua.

Those are for my personal projects. If I am working on a team and that team has different conventions, I use those.
For identifiers/variable names, I go with the Ruby / Rails convetion; "Types" and whatever represents them are CamelCased and Uppercased, methods, properties etc. are snake_cased and lowercased.

s-ol.nu /blog  -  p.s-ol.be /st8.lua  -  g.s-ol.be /gtglg /curcur

Code: Select all

print( type(love) )
if false then
  baby:hurt(me)
end
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 2 guests