• Phen@lemmy.eco.br
    link
    fedilink
    English
    arrow-up
    13
    arrow-down
    2
    ·
    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.