Page 1 of 1
Tab vs space madness
Posted: Sun Aug 26, 2012 9:17 am
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.
Now I know better. Tab to indent, space to align! Time to go back and fix some of my projects.
Re: Tab vs space madness
Posted: Sun Aug 26, 2012 10:48 am
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.
Re: Tab vs space madness
Posted: Sun Aug 26, 2012 11:09 am
by Nixola
Some as 6, and some will let you choose
Re: Tab vs space madness
Posted: Sun Aug 26, 2012 11:12 am
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.
Re: Tab vs space madness
Posted: Sun Aug 26, 2012 5:10 pm
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.
Re: Tab vs space madness
Posted: Sun Aug 26, 2012 5:53 pm
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.
Re: Tab vs space madness
Posted: Sun Aug 26, 2012 6:38 pm
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.)