3 ms·
You do the indenting with tabs and the layout with spaces. Then it doesn't break
by cyclotron3k 3y ago
You do the indenting with tabs and the layout with spaces. Then it doesn't break
- lttlrck 3y agoYes that works. Until a variable name changes which could cause the alignment to cross a tab boundary so then instead of just fixing the alignment with spaces you have to convert existing spaces to tabs and realign. It's just more work and to do it reliably requires making tabs visible in the editor though, which is another mark against tabs for many, I'd imagine. I suppose there may be Vim/Emacs realignment macros that take care of it but then we're heading toward the other classic argument.
- cyclotron3k 3y agoI think we're talking about different things. The rule is: nothing should appear to the left of your tabs - use spaces everywhere else. Here's what it should look like (if you really want to go full-alignment): class Demo { \tfunction thing() { \t\tlet height = 123; \t\tlet width = 456; \t\tlet title = "Foo"; \t\tlet description = "Foo bar baz"; \t} }