3 ms·
You want source code indentation to be random on different machines? I guess. That would make me crazy.
by OhMeadhbh 6mo ago
You want source code indentation to be random on different machines? I guess. That would make me crazy.
- donatj 6mo agoYes. That is the point. I can have my tabs look the way I like them. You can have your tabs look the way you like them.
- xigoi 6mo agoUntil you open your code somewhere where you can’t configure the tab size, such as on SourceHut or other forges.
- OhMeadhbh 6mo agoOr if you have your tabs set at 3 and I have mine set to 4 and you want to indent something 6 characters so you enter two tabs. When the code gets back to me it's indented 8 spaces and nothing lines up anymore. So I change it to one tab and 2 spaces and when it gets back to you it's indented 5 spaces instead of 6, so you change it back to two tabs and we spend our time indenting code to make it readable instead of doing our jobs We had such vicious battles at Convex we wrote a tool that "canonicalized" code before it was checked in and then "decanonicalized" after checking out. There were issues with comments, but they were manageable.
- OhMeadhbh 5mo agoThink of it as tabs are set to 0 spaces, and then additional space characters are added to ensure lines indent to the columns you want them to line up to. And then you delete the tabs at the beginning of the line.
- Silamoth 6mo agoIt’s not “random”, it’s whatever you’ve configured it to on your machine. Your choice of (e.g.) 3 spaces per tab shouldn’t be forced onto me if I prefer (e.g.) 4 spaces per tab. As long as you’re on your machine, you’ll see exactly the amount of code indentation you prefer - not something “random”. On someone else’s machine, well, that’s up to their preference, and it’s hard to complain about how someone else has their machine setup. TL;DR: This is a feature, not a bug
- OhMeadhbh 6mo agoSo when things don't line up... That's a feature? The reason I use indentation is so there's consistency between lines. When you use spaces, the semantics of indentation are maintained. If you don't like the indentation settings, just change them in the v-linter.
- 1718627440 6mo agoTabs represent a logical indent, not a physical one, you choose how the mapping to physical indent is. > So when things don't line up Why would things ever not line up? There is 1/2 tabs indentation and it shows up as 1,3,7,8,42/2,6,14,16,84 indentation however you like it.