Jasoco wrote:
Sounds like a personal choice. Personally I hate when I download a .love and the files use 2 spaces instead of a tab. The point is with tabs, they always use spaces. So if I press tab to add new text it'll match the rest. If I download your .lua file with 2 spaces per tab and mine is set to 4 spaces, it will not show up right.
Since I have tab mapped to two spaces when opening Lua files, when I press tab in your tab-based file, it neither aligns (unless I convert tabs to spaces before, which I always do
)
Jasoco wrote:Tabs are superior. Tabs are king. Tabs should not be denied.
Try not to get too attached to a particular indentation policy. Don't be "a tabs guy" or "a spaces guy". The truth is that each style has its merits.
Regarding indentation, some languages admit "whatever"(C, C++, Java). Those are the worst, because they create discussions like the one we're having now.
More civilized languages have indentation rules, or at least recommendations. Some recommend spaces (
ruby,
python), and others tabs (
go).
When I am programming in a new language, I do what is "standard" in that language. So I use spaces when I do ruby, and tabs in Go. And I am happy that I didn't have to make the choice myself, and don't have to fight anyone about it, and I can move on writing code.
Jasoco wrote: unstandard 2 spaces per tab when tabs are generally always displayed at 4.
It depends on your definition of "standard". Lua's creators declined to explicitly say "the recommendation is using xxx for indentation". That, in my opinion, was a mistake, because now everyone has to "choose a camp" and "fight the other camp".
In my case, when I write Lua, I use two spaces, simply because that's what PIL does (I don't share Bartbes' opinion that that's because it is a book; even the C source code used in Lua is two-spaces-based). I didn't impose my personal preference, I actually tried to find an existing rule or recommendation, and that's the best I could find.
So no, in Lua, it is not "standard" to use tabs. Neither is using spaces. Although I think that there's a bit more implicit preference for them by the language's authors, and that's why I use them.