Hacker News new | past | comments | ask | show | jobs | submit login

I believe what the comment you're replying to is implying multiple instances of indentation on the same line. Such as:

    if		( $test[0] )	func1()
    elseif	( $test[1] )	func2()
    elseif	( $test[2] )	func3()



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. :-)


Elastic tabstops would solve this: http://nickgravgaard.com/elastic-tabstops/




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: