top | item 6688061

(no title)

jbri | 12 years ago

The optimal mechanism is to indent with tabs, and align with spaces (that is, you have the same number of preceding tabs as whatever you're trying to align with, and then use spaces from there).

Though setting your editor up to do that automatically is an incredible pain, and it kind of forces you to use a monospace font.

discuss

order

Locke1689|12 years ago

Ah, I didn't see the distinction between "indent" and "align."

Anyway, it seems like this system necessitates that the leading white space on a given line must be a mixture of both tab characters (\t) and spaces, unless one sets their editor to insert space characters as tabs (which is standard), and is obviously living in a state of sin.

sesqu|12 years ago

On every line that is right-aligned, yes. Most lines would have only tabs.

XorNot|12 years ago

Who isn't using a monospace font for code editing? I didn't even realize this was a thing.

jbri|12 years ago

The primary reason people use monospace fonts is historical inertia. It's definitely worth trying out a proportional font if your environment is amenable to it (some tools don't cope particularly well, for sad and disappointing reasons).

ufo|12 years ago

IIRC, Stroustoup uses a non-monospaced font in his C++ book.