Tab vs space madness

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Locked
User avatar
dreadkillz
Party member
Posts: 223
Joined: Sun Mar 04, 2012 2:04 pm
Location: USA

Tab vs space madness

Post by dreadkillz »

After seeing how my code on github doesn't look like it does on my computer, I went and learned about all this tab vs space madness and different settings on different computers. Before I was using tabs to align things like = ; etc. BAD BAD BAD. :halloween: Now I know better. Tab to indent, space to align! Time to go back and fix some of my projects.
User avatar
T-Bone
Inner party member
Posts: 1492
Joined: Thu Jun 09, 2011 9:03 am

Re: Tab vs space madness

Post by T-Bone »

Well, Lua doesn't read whitespace so it doesn't matter too much.

Also note that tabs depend on the text editor. Some interpret them as four spaces, some as eight. Always avoid mixing tabs and spaces.
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Tab vs space madness

Post by Nixola »

Some as 6, and some will let you choose
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Tab vs space madness

Post by kikito »

Or, two spaces for everything, no tabs at all.

EDIT: by the way, this seems to be the recommended way to do it on the Lua Style Guide.
When I write def I mean function.
User avatar
ivan
Party member
Posts: 1918
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

Re: Tab vs space madness

Post by ivan »

kikito wrote:Or, two spaces for everything, no tabs at all.
Yep, sounds good. In fact Notepad++ has a setting that replaces your tabs with spaces automatically.
User avatar
dreadkillz
Party member
Posts: 223
Joined: Sun Mar 04, 2012 2:04 pm
Location: USA

Re: Tab vs space madness

Post by dreadkillz »

I really like tabs though for indenting. I ended up downloading a plugin for np++ that uses tabs to indent and convert them to spaces when used otherwise.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Tab vs space madness

Post by bartbes »

What is this flamebait doing here?
I shall now lock this thread, to prevent endless tab vs space discussions, we all know tab is better anyway. (And vim is better than emacs.)
Locked

Who is online

Users browsing this forum: No registered users and 5 guests