r/linux • • Apr 14 '21

Kernel [RFC] Rust support in the Linux kernel

https://lkml.org/lkml/2021/4/14/1023
608 Upvotes

316 comments sorted by

View all comments

Show parent comments

9

u/[deleted] Apr 14 '21

I use a tabstop of 4 or 6 depending on my font.

It's like people don't even consider that not every monospace font has the same width.

11

u/inamestuff Apr 14 '21

Same, and I also used to indent with a width of 4 or more, but currently I'm using a width of 2, just because of personal preferences. No changes to the source code required, just a simple setting in the IDE/Text Editor and that's it - as it should be

0

u/natterca Apr 14 '21

I don't see why an editor couldn't do the same thing with leading spaces.

6

u/Autoradiograph Apr 15 '21

Of course an IDE can reindent your code, but that would change every line of the file unnecessary. Unless you're talking about virtually hiding certain spaces. But either way, that leads to a larger problem:

How can the IDE tell the difference between the spaces used for an indent from the additional leading spaces on that same line used for lining things up neatly?

The proper solution is to use tabs for indenting, then additional spaces for alignment of multi-line lines of code. Then people can set their preferred tab stop in their settings and everything just works.

7

u/dreamer_ Apr 15 '21

It shouldn't.

0

u/[deleted] Apr 14 '21

[deleted]

0

u/[deleted] Apr 14 '21

[deleted]

0

u/[deleted] Apr 15 '21

[deleted]

7

u/Autoradiograph Apr 15 '21

I think you're missing the whole point. People are saying they want an indent to look a certain width. If you change to a narrower font that indent will also look narrower. So if tabs are used instead, when they switch to a narrower font they can increase the tab width to keep indents looking the same because maybe that helps them understand the code at a glance easier.

0

u/[deleted] Apr 15 '21

[deleted]

0

u/Autoradiograph Apr 15 '21

Then I don't know what you're trying to say, and I don't care to figure it out.

0

u/[deleted] Apr 15 '21

[deleted]

0

u/[deleted] Apr 15 '21

[deleted]

0

u/[deleted] Apr 15 '21

[deleted]

0

u/[deleted] Apr 15 '21

[deleted]

0

u/[deleted] Apr 15 '21

[deleted]

0

u/[deleted] Apr 15 '21

[deleted]

→ More replies (0)

0

u/[deleted] Apr 15 '21

Yes, and because thr font is not in the files, people ARE going to use different fonts, resulting in the described problems.