May 4, 2025
Trending News

https://www.xataka.com/aplicaciones/estan-programadores-que-usan-tabuladores-programadores-que-usan-espacios-luego-esta-linus-torvalds

  • April 18, 2024
  • 0

There are people who love pineapple pizza, and there are people who inexplicably don’t. There are people who prefer potato omelets with onions, and there are also very

https://www.xataka.com/aplicaciones/estan-programadores-que-usan-tabuladores-programadores-que-usan-espacios-luego-esta-linus-torvalds

There are people who love pineapple pizza, and there are people who inexplicably don’t. There are people who prefer potato omelets with onions, and there are also very crazy people who like them without onions. And then there’s the most important programmer discussion: You’re either for tabs or you’re for spaces.

This is one of the specific battles of developers who join other well-known battles of Linux distribution users, such as the war pitting vi against emacs or GNOME against KDE. However, as we said, this situation especially affects developers, who have been debating for years whether the code should be indented with tabs or spaces.

The problem is that some code parsers (parsers) does not provide adequate support for tab stops; which can cause the code to actually fail.

Fed up with this situation, Linus Torvalds decided to release a patch for one of the Kconfig configuration files. I made a little joke: changed some spaces and replaced them with exact spaces so parsers will produce an error failing to detect this condition which they are supposed to detect.

Linus’ goal here was clear: to get the developers of these parsers to get to work and make the necessary changes to properly support the tabulators. In the past, Linus would probably have reacted much more strongly, but this behavior is much more subtle. As he explained when publishing the patch:

It wasn’t clear which device it was, but we’ll make sure it’s fixed. Because if you can’t parse tabs as spaces, you shouldn’t parse core Kconfig files.

In fact, Torvalds stated that he would continue to add random tabs to some Kconfig files to continue to persist with the problem until third-party tools, which he did not identify, fixed the problem. Because having certain exceptions regarding the use of tabs in Kconfig does not excuse anything.

And that doesn’t excuse it because There’s no argument worth it for Linus Torvalds. Tabs are the only valid method of indenting code.

And period.

The eternal holy war of tabs against space

The hate and love on this subject comes from afar. Afar. Some have called this confrontation ‘Tabs versus Spaces’ the eternal holy war of the year 2000, and the Linux kernel programming documentation itself makes clear the position of the developers of this important technological pillar of today:

Except in comments, documentation, and Kconfig, spaces are never used for indentation, and the above example is deliberately broken.

So if you are a programmer and are collaborating on the development of the Linux kernel, spaces for indentation are basically prohibited —or indentation is a foreign term that currently has no approved meaning in DRAE—of the code.

Linus Copy 2

In 2007, Linus Torvalds responded to another Linux development contributor: soften the debate. That said, you’ll eventually have to deal with people (mostly Windows programmers) who use spaces instead of tabs, but Linus has already made his position clear.

“One of the reasons Really I want to use pure tabs [equivalentes a 8 caracteres] makes patches look better,” he explained, and warned of the danger of mixing styles and combining indents with tabs and spaces. “If you use spaces (or worse, mix both methods), things look really terrible. In defending this practice, he made it clear that pure schedulers were his “reference criterion”.

Certainly, The debate and “holy war” continued in the following years. Some languages ​​bring their own game rules here, as developer Robert Truesdale explained a few months ago. The Python Development Advisory (PEP 8), the reference for developing code in this programming language, recommends using four spaces per indentation level, while Google’s Java Style Guide specifies using two spaces per indentation.

Curiosity goes further, and there are many studies and surveys that take the pulse of the issue, for example. As Truesdale points out, spaces have historically been the choice in business environments, and there are actually (controversial) studies that reveal that developers who use spaces make more money than those who use tabs for indentation.

This battle between tabs and domains was also reflected in an episode of the series ‘Silicon Valley’ and has always created strong support on both sides. Jeff Atwood, co-creator of Stack Overflow, was a devoted fan of tabulators and wrote a fantastic (and ironic) piece in 2009 condemning “space heretics” to death. In one of the logically provoked reactions, there were those who supported it by citing a very ecological justification: Spaces are destroying the planet.

You already know. No indentation with spaces. And long live pineapple pizza and potato omelet with onions.

Image | TED Conference | Linux Foundation

in Xataka | And programmers’ favorite code editor… 8 professionals answer us

Source: Xataka

Leave a Reply

Your email address will not be published. Required fields are marked *