3 ms·
This isn't true, because lining things up visually works differently with tabs than with spaces. (Although, personally, this is why I never visually align code
by RussianCow 8y ago
This isn't true, because lining things up visually works differently with tabs than with spaces. (Although, personally, this is why I never visually align code like that, but that's the standard style in many organizations/languages.)
- tobr 8y agoI will never understand why people get so religious about tabs vs spaces, but this is a hill I’m willing to die on: please don’t line things up visually in your source code, beyond standard indentation.
- int_19h 8y agoThere are some popular coding standards that essentially require it, unfortunately. My opinion on this is that it's a bad idea in the age where we (finally) have near universal acceptance of source control, because they bloat commits with irrelevant changes in surrounding lines to preserve alignment when identifiers change. Black got it exactly right - optimize for readability and change locality.
- thecatspaw 8y agowhy are you against it?
- tobr 8y agoIt’s brittle and fiddly, and it’s basically the only way to make it impossible to use proportional fonts, which are much more important for readability. If you feel like it’s useful, you should probably be using an editor with real elastic tabstops instead.
- deleted 8y ago[deleted]
- andrewprock 8y ago"It’s brittle and fiddly" You picked the wrong vocation my friend. It's "brittle and fiddly" all the way down.
- masukomi 8y agothe fact that most editors use mono-space fonts by default and hardly anyone is clamoring for the ability to use proprotional fonts seems to argue against them being particularly important to readability, at least as far as the community seems to be concerned. re "you should probably be using an editor with real elastic tabstops" ... i don't get what you're trying to say. What does real or fake elastic tabstops have to do with the choice to align code beyond just indentation?
- tobr 8y agoManual alignment is often used as a poor man’s elastic tabstops. I think there’s a chicken-and-egg situation with monospaced type and programming. Programming was a thing before digital proportional typefaces were a thing, so some people came to rely on the fixed spacing to treat their source code as a 2d grid rather than a 1d buffer. This in turn made it more difficult to switch over to proportional typefaces despite their advantages, and at some point code == monospaced was just taken for granted. Another issue that comes from mistaking your code for a 2d mosaic is the dogma of dictating a maximum number of characters per line, instead of the more reasonable approach of using whatever expresses the structure of the program most clearly, and relying on line wrapping to make sure it’s all visible. FWIW I use proportional fonts, and 95% of the time it’s completely unproblematic. Fortunately I rarely work with code that uses manual alignment. It’s usually the occasional ASCII diagram that forces me to temporarily switch over to fixed pitch.
- deleted 8y ago[deleted]
- masukomi 8y ago> but this is a hill I’m willing to die on: please don’t line things up visually in your source code, beyond standard indentation. what's the argument against this? There are many arguments for how it can improve readability and speed up understanding of what you're looking at when you're not familiar with it.