• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Usage of tabbing when writing Lua scripts!

Korrex

Intermediate OT User
Joined
Jan 19, 2008
Messages
2,748
Reaction score
109
Most of the Lua scripts I see posted here are without the use of "Tabbing" which imho makes the code look alot cleaner.

For those of you that don't know tabs in coding is when you press the "TAB" button in say notepad++ and it moves it one "column" further just for better look and cleaner scripts that don't give you a headache.
Another argument is that you can also see where an "if" statement ends and where a "function" ends.
its also easier to find/notice/trace and correct any errors if its tabbed properly

I'll show an example, first a script using tabbing.
Lua:
function blabla()
	if bla == bla then
		print("bla = bla")
	end
end
As you can see this looks alot better than this script that doesn't use tabbing.
Lua:
function blabla()
if bla == bla then
print("bla = bla")
end
end
So please the next time you decide to post a Lua script, could you be kind enough to post it like the first example with the usage of tabbing.
 
Last edited by a moderator:
its also easier to find/notice/trace and correct any errors if its tabbed properly
 
Signed, although a tab size should be 4 instead of 8.
 
Signed, although a tab size should be 4 instead of 8.

I use 8 in every IDE, hihi.

@Topic:
I totally agree with Cykotitan's post, sometimes when I see very bad tabbed script I rather write it myself from scratch than fix the script because it's hard to read non-tabbed codes.

@Korrex:
The language is Lua, not "LUA". :p
 
Last edited:
I use 8 in every IDE, hihi.

@Topic:
I totally agree with Cykotitan's post, sometimes when I see very bad tabbed script I rather write it myself from scratch than fix the script because it's hard to read non-tabbed codes.

@Korrex:
The language is Lua, not "LUA". :p
Same shit different names, but fine enough i'll change it just for you :p.
 
Most the time its the editor that fucks up the tabbing. Yesterday I had to edit my post almost 10 times before it looked okay. (and I agree the tab size should be 4)

Anyways fix the damn editor. It's annoying.
 
Moved the thread to Tutorials --> Basic.

I would also like to recommend users to download Notepad++ and write the LUA code there before posting it on otland.
 
Back
Top