Technology

Linus Torvalds reiterates his tabs-versus-spaces stance with a kernel trap

Tab soda displayed on a grocery store shelf
Enlarge / Cans of Tab diet soda on display in 2011. Tab was discontinued in 2020. There has never been a soda named “Spaces” that had a cult following.

Getty Images

Anyone can contribute to the Linux kernel, but anyone’s commit suggestion can become the subject of the kernel’s master and namesake, Linus Torvalds. Torvalds isn’t too big on kindness, although he’s been working on it since 2018. You can get a glimpse of this newer, less curse-laden approach in the way Torvalds recently approached an engagement he was with fiercely disagree. This involves tabs.

Last week’s commit changed exactly one thing on one line, replacing a tab character with a space: “This helps Kconfig parsers read the file without errors.” Torvalds responded with a commit of his own, as spotted by The Register, which would “intentionally add hidden tabs.” Trying to fix the problem of tabs versus spaces seemed to awaken Torvalds to the need to make tab detection failures “more obvious.” Torvalds would have added more, he wrote, but he didn’t “want to make things uglier than necessary.” But it *might* be necessary if it turns out we’re seeing more of this kind of silly tooling.”

If you’ve read this far and don’t understand what’s going on, allow me, a failed CS minor, to offer you a quick explanation: tabs versus spaces will never truly be resolved, codified or corrected by standards, and energy Efforts devoted to this issue over time could, if harnessed, power one or more small nations. However, the Linux kernel has its own coding style, and it directly cites “K&R” or Kernighan & Ritchie, the authors of the coding bible. The C programming language, which is a tab book. If you’re submitting kernel code, it’s best to use tabs (eight-character tabs, ideally, although some of this has to do with the history of teletype and online printer).

By attempting to smooth out a tiny part of the kernel so that an analysis tool could see a space character as a bounding space, Prasad Pandit inadvertently prompted a robust rebuttal:

It’s not clear exactly what tool this is, but let’s make sure it gets fixed. Because if you can’t parse tabs as spaces, you shouldn’t parse kernel Kconfig files.

In fact, let’s make such a break more obvious than an esoteric trace record size option. If you can’t parse tabs, you can’t have page sizes.

Yes, the confusion between tab and space is unfortunately a traditional Unix thing, and “make” is famous for being broken in this regard. But no, that doesn’t mean everything is fine.

Torvalds’ hidden tabs appear in the fourth release candidate of Linux kernel 6.9, which Torvalds said “nothing particularly unusual was happening” the week it was released.

Disclosure: The author is a surfer in that he has some idea of ​​what he is doing.

This post was updated at 6:33 p.m. EST to address some line break issues in the Torvalds blockquote. The irony was duly noted. Better link regarding Tabs Vs. Spaces debate was also switched.

News Source : arstechnica.com
Gn tech

Back to top button