this post was submitted on 16 Apr 2024
36 points (95.0% liked)

Linux and Tech News

1011 readers
1 users here now

This is where all the News about Linux and Linux adjacent things goes. We'll use some of the articles here for the show! You can watch or listen at:

You can also get involved at our forum here on Lemmy:

Or just get the most recent episode of the show here:

founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 12 points 7 months ago

Programmers use a margin on the beginning of a code line to easily identify that that line is related to a previous line (for example, one line may establish a condition and the next line an action to be executed on that condition, the line with the action will have this margin in this case).

There are basically two ways to create this margin: by adding a tab character or by adding spaces. The tab character is a special character that exists specifically for things like this and most tools allow you to configure the size of the margin it adds. Spaces on the other hand have a fixed size so if you add two spaces the margin will always be of two spaces.

Programmers have forever argued about their preferences on this and it often results in very heated arguments.

Tabs are generally considered the best choice but many people disagree, usually because of one of those three things:

  1. they think that people who use tabs want to replace all usages of spaces with tabs and not just this specific use case. Then demonstrate how tabs can be unpractical on other situations (that don't really have anything to do with the original argument).

  2. they use (or need to use) some shitty tool that do not recognize tabs properly, or that force an unpractical tab size on them (not as common these days as it used to be, but still happens).

  3. they actually want everyone to always display those margins with the same size regardless of each individual's personal preferences.