How can a code editor hint at code nesting level without indentation?
programmers.stackexchange.com
programmers.stackexchange.com
If we got rid of indentation, I'd like to think it was replaced by something that took less space, not more.
This is actually a really interesting question, although I'm not sure the answers there are very helpful. I would prefer seeing the code actually indented, and then a light-gray visual guideline where the structural indentation ends, e.g.:
|<xml:something>
|<xml:what-the>
| left some extra whitespace
|</xml:what-the>
|</xml:something>Or is the effect you want slightly different?
Good luck with that, considering I find it hard to manually decide how to indent mixed PHP, HTML and Javascript code. I can't imagine an automatic tool having any success.
<?if(bool):?>
<TABLE class="foo">
<?else:?>
<TABLE class="bar">
<?endif;?>
<TR><TD></TD></TR>
</TABLE>
If you only look at the HTML it looks like a doubly nested table.If you only look at the PHP the inner elements of the table will not be indented correctly.
And this is a very simple example. Real code can be far more complex - for example the table tag could be generated by a function, and not even visible in this file.
If you took my indenting, and converted it into some kind of graphical display that might be cool. But automatic detection? Good luck.
XCode does this in a single column using varying shades of grey:
http://i.stack.imgur.com/frCcI.png
The grey rectangles may also be clicked on to fold text. On hover you see: http://i.stack.imgur.com/EzjXW.png
And after folding you see: http://i.stack.imgur.com/wsNRR.png