Re:When monospace fonts aren't: The Unicode character width ...
by djent on Friday September 11, 2015 @09:27PM
(#10206920)
I believe what the comment you're replying to is implying multiple instances of indentation on the same line. Such as:
[ Parent
| on HN ]
Re:When monospace fonts aren't: The Unicode character width ...
by Stratoscope on Friday September 11, 2015 @10:18PM
(#10206999)
That's a good point. Well, it was just an excuse for me to go off on a tangent! :-)
For the example you posted, I would classify that as column alignment rather than indentation. Just to clarify my terminology, what I call indentation is something that happens at the beginning of a line only. Any additional spacing after the first nonblank character is column alignment.
So the spaces before the if and elseif are indentation, and the extra spaces within the lines are column alignment (in my nomenclature).
The column alignment in your example is pretty appealing, but it does have some of the same problems as other forms of column alignment. When we get to ten or eleven tests, things have to get juggled around again. Do you do this:
if ( $test[0] ) func1()
elseif ( $test[1] ) func2()
...
elseif ( $test[10] ) func3()
or this? if ( $test[0] ) func1()
elseif ( $test[1] ) func2()
...
elseif ( $test[10] ) func3()
or go all-out with something like this? if ( $test[ 0] ) func1()
elseif ( $test[ 1] ) func2()
...
elseif ( $test[10] ) func3()
I think basically I am just lazy and found all of this alignment so tedious that I looked for ways to avoid it. :-)
Re:When monospace fonts aren't: The Unicode character width ...
by Symbiote on Saturday September 12, 2015 @05:02AM
(#10207637)
Elastic tabstops would solve this: http://nickgravgaard.com/elastic-tabstops/