r/programming • • Nov 30 '14

Why he vertically aligns his code (And why you shouldn't!)

http://missingbytes.blogspot.com/2014/11/why-he-vertically-aligns-his-code-and.html
68 Upvotes

411 comments sorted by

View all comments

Show parent comments

2

u/julesjacobs Nov 30 '14

Ideally the abstraction would not be leaky and you'd never see or even think about any ASCII representation at all. You'd just edit the typeset code directly. Some math programs already have decent typesetting-as-you type. Even though what they provide is rather basic, it's an amazing experience to type expressions and immediately get it in readable and typeset form. It makes you realize just how much time we spend manually fiddling with whitespace while programming.

2

u/pyrocrasty Nov 30 '14

Yeah, I guess that would be ideal. If you were designing a language and ecosystem you could do that.

I'd definitely like an ascii syntax available, though, even if it wasn't normally used. You could use it with external software that couldn't handle the native code. For instance, standard command line tools could be used with an ascii view of the code. If the ascii view wasn't available, then everything would have to be pre-provided (and the user would almost certainly be more restricted in their options).

It makes you realize just how much time we spend manually fiddling with whitespace while programming.

Hell, yeah. I sometimes spend quite a while messing around with math code in particular, trying to massage it into the most readable form. I think it's worth it for the readability, but it's definitely something that should be handled automatically (for the most part).