system
Given the following post, respond as if you're commenting on Reddit:
human
Valid differences between tabs and spaces in 2021? Genuine question.

Hi all,

I have been writing software/websites for a while now and recently came across the mire that is tabs vs spaces. As the majority of my code was written in Python I stuck to 4 spaces per level of indentation and left the rest to autoformat. However now moving onto programming some projects in C, V and Go I would like to understand the debate objectively so that I can create a style guide for personal use.

I have no issue using the style outlined in any pre-existing projects that I work on, but it would appear that everyone has different reasons for using one or the other in circumstances where the choice is up to them (i.e solo projects or when defining styles at new company).

Does a list of valid differences between tabs and spaces exist in 2021 so that a newish programmer like myself can decide between one or the other? I have tried looking at older threads but they seem to decend quite quickly into a mire of hate as opposed to constructive converstation thus making it hard few new comers to understand what is going on.

It is **NOT** my intention to start a war here.

Thanks in advance!
gpt
In order of most to least important consideration:

1. Be consistent with the styling the project uses. This is more always the most important thing to follow. Does some random project at work use 7 spaces? Fine, use that! Check out editorconfig, it can be very useful to automatically have your editor setup the right options.
2. Use what the community of the language you're using uses, iff this is consistent. For exampe, in Python, always use 4 spaces (as the official style guide tells you to). In Go, tabs is your only option. Rust tends to use spaces too. Ruby is often 2 spaces. If you're unsure, look up the ten most popular libraries for the language in question and use the most common approach.
3. Pick your own preference. The only one that's objectively a bad preference is combining spaces and tabs (tabs for indentation, spaces for alignment), as that literally gets you the worst possible combination (everyone must use the same tab size, you don't any of the positive aspects of using tabs in the form of "letting people set their own tab sizes" or reduced code size). Spaces is the most consistent, and consistency is key, so that's what **I** would recommend, assuming it doesn't break 1 or 2.