3 ms·
Do all text editors render "tab" with variable width, taking you to the next tab stop? For some reason up until now I was thinking that was always a word proces
by krackers 3y ago
Do all text editors render "tab" with variable width, taking you to the next tab stop? For some reason up until now I was thinking that was always a word processor thing and I incorrectly assumed (perhaps because we usually don't use tabs for their original purpose) that a tab character was always rendered as constant width.
- infogulch 3y agoI don't know of any text editors that don't render variable width tabs based on the tabstop position. In programming environments we usually only use tabs at the beginning of the line for indentation, it's a bit more rare to use them for alignment due to inconsistent tabstop settings. There's also Elastic Tabstops if you want to go all in on using tabs for alignment: https://nick-gravgaard.com/elastic-tabstops/ https://nick-gravgaard.com/elastic-tabstops/
- Brananarchy 3y agoI maintain, that if everybody used a sufficiently smart editor, tabs for indentation and spaces for alignment would be the objectively correct choice.
- silon42 3y agoAs long as we agree that the line length limit will be based on tab=8... are there smart editors that can check that?
- Brananarchy 3y agoI consider line wrapping to also be part of a sufficiently smart editor, and line limits should also go away in an ideal world. The limiting factor on line length should be "is this too complex for your coworkers to understand"
- GoblinSlayer 3y agoA sufficiently smart editor can figure out everything by itself and doesn't need preformatted text.
- Shish2k 3y agoIf everybody used a sufficiently smart editor, and used sufficiently smart codegen, and we removed all the existing breakage from our tools and infrastructure, yes. I wish I lived in that world. TBH my money is on that never happening, but maybe we will skip to an even higher level, where the canonical format for source code is the AST rather than plain text - indentation, braces, line length, all the things that humans care about but the computer doesn’t become render settings.
- 95014_refugee 3y agoIt’s happened more than once. Itemis built a whole pile of tools on it, and the things it enables (stacked DSLs lowering to C, for example). Sadly, nobody wanted it. Check out https://mbeddr.com https://mbeddr.com and weep for what could have been.
- globular-toast 3y agoYes. This is the point of tabs. I'm convinced the whole tabs vs spaces thing is really people who understand this vs people who don't.
- RedNifre 3y agoIt's a typewriter thing and meant for writing tables, so tab has always advanced the cursor to the next "tabular" stop. What would be the use case of having them fixed width?
- GoblinSlayer 3y agoMore importantly not all editors use monospace font and can render tab shorter than space, so tabs in the middle of text make little sense.