Brendan, I totally agree with you. For code examples in HTML pages the non-breaking space is probably the best character for indentation and alignment and it would be great if the Wiki supports it (I have not checked that yet).
Personally, I use tabs for indentation and spaces for alignment:
Code:
struct mystruct
{
<tab>int myvar;<sssppppaaacccceee>// Always 0.
<tab>int my_long_named_var;<space>// Never 0.
};
The tab count at the beginning of each line is equal to the indentation depth - it is independent from the preference on
visual indentation, i.e., whether indentation levels should be separated by 2 spaces, 4 spaces, 8 spaces... If you open the code in an editor, you can set the tab width to anything you like. If you don't like what you see, you misconfigured your text editor. If your text editor doesn't support configuring the tab width, you're using the wrong editor.
Of course alignment should be independent of editor settings, so I use spaces for this purpose. No matter which tab width I use, the two comments from my example will always be aligned.
So the question remains: how would I align things which are at different indentation levels? Simple answer: I don't. In my code, each aligned block of comments, variables or whatever belongs to only one indentation level. For me there is simply no need to align comments across indentation levels.