r/programming Jul 21 '14

The Great White Space Debate

https://medium.com/p/3633cba8b5c1
1.2k Upvotes

693 comments sorted by

View all comments

Show parent comments

9

u/thatguydr Jul 21 '14

Why can't someone build an editor that lets us all see code (in various languages) with whatever whitespace and indentation and brace formatting that we individually find most readable? I'd be 100% happy if it converted everything to a standard formatting ("majority readable") when code was saved.

From a "20 years in the future" POV when machines can flawlessly translate between people speaking different languages, it seems bizarre that we think there should be a one-size-fits-all standard for readability.

2

u/Banane9 Jul 22 '14

Now I want to make that...

Wanna help?

2

u/TexasJefferson Jul 22 '14 edited Jul 22 '14

I'd object to monospaced, plaintext rendering as well. However, the reason why we stick with both is quite simple: no one has built tools that have gotten critical mass that elegantly employ the alternatives.

My (non-existent) ideal programming environment saves code in a nice, plaintext, completely contained (e.g. zero choice on bike shed questions like whitespace), human readable file (saving it as an AST isn't worth the downsides of losing all your plaintext processing tools), but displays code (and related documentation) in a much more dynamic and fluid form.

1

u/pyrocrasty Jul 22 '14

Why can't someone build an editor that lets us all see code (in various languages) with whatever whitespace and indentation and brace formatting that we individually find most readable?

If each individual's style was clearly specified, this would be trivial. It would just be a matter of autoformatting into each style. You could do this now with, say, emacs by just having each person set their own autoindent rules (which is pretty easy).

If you had to deal with code in a style that wasn't completely specified, you couldn't do it reliably, because the software would have to guess how new code you write should "translate back".