• Subject: Re: Tab versus space indentation, and source code control systems... (was: Re: Style guide?)
• From: Dirk Laurie <dirk.laurie@...>
• Date: Fri, 16 Jun 2017 08:03:19 +0200

```2017-06-16 2:22 GMT+02:00 Soni L. <fakedme@gmail.com>:

> Spaces are superior because you can instantly tell who wrote what, since
> different ppl use different indentation levels. (/s)
>
> (At the end of the day, it all comes down to personal preference. I have
> used logarithmic indentation before.)

Another possibility is Fibonacci indentation, 1,2,3,5,8,13,.... You can think
of it as a generalization of the standard tab stop of 8 spaces, since 8 is
a Fibonacci number.

It has the theoretical advantage of being unbounded, although in practice
it becomes hard for the human eye to distinguish between a line-wrapped
89-space indentation and an empty line followed by an 8-space indentation.
If this bothers you, use reverse Fibonacci indentation, e.g. 8,5,3,2,1.

Most sophisticated of all is bidirectional indentation: reverse Fibonacci for
comments, forward Fibonacci for code. This has an attractive "wavy"
appearance.

--- First  line of a standalone comment block (13 spaces)
-- Major heading inside a comment block (8)
-- Actual comment (3)
-- allowing three (2)
-- levels (1)
-- of subdivision (0)
function abc(...)
local a,b,c = ...
if type(a)=='string' then
for pos,char in a:gmatch"()(.)" do
-- inline comments come at the level where the code would be
if char:match"%u" then
while true do
if p:upper():match"Q" then
os.exit(pos)
end
end
end
end
end
end

Such a systems requires some mental arithmetic from the user. It is easy
to say that if such an effort is beyond you, then computer programming
is not a sound career option, but no matter how good you are, some of