Hi guys!
This is just a little something for people to help people coding...
1. INDENTING
Most people I have seen on theses forums dont INDENT their code. When I say indenting I mean per block of code you should leave 4 or 2 spaces. A block (for you who dont know) is a function and an end code. Eg.
if someVar == anotherVar then
print("Doing something")
end
from the if to the end is a block and notic how I indented my code in between the block? This should be done with every block even the block block is in another. Eg.
if something then
while true do
print()
end
end
2. SPACING
Again not many people space their code out.. Eg.
if sV==vS then
print(sV)
end
I like to keep my code spread out. Eg.
if sV == vS then
print( sV )
end
You can put spaces between OPERATORS, brackets and all sorts of stuff.
3. COMMENT
Comment your work. Eg.
if someVar == thatVar then -- Test someVar againist thatVar
print() -- Print something
end -- End if block
Commenting will not be read by Lua but keep in mind after you have typed the -- it will comment out the rest of that line.
mniip:
@Linearus (View Post)
3) i'm sure THAT kind of code is understandible without comments, and there is code i don't really want others to undersand
Well I'm sure you haven't seen some of my code.