How should programmers indent their code? Tabs or spaces? It’s an old question that will never have everyone in agreement!
On the one hand, those in favour of tabs argue that it provides more precision. Equally those in favour of spaces argue that if it was about presicion then woudn’t you use spaces! Some space fans ague that tabs look different on different computers. Some tab fans argue that tabs create a smaller file size.
In 2016 one of Google’s developers tried to settle the debate by pasing a billion files from 14 programming languages! Which one came out on top would be the winner. The results showed that spaces were the most popular method of indenting code. Interestingly there were two execptions where tabs were the most popular – C and Go. A fascinating piece of analysis but it doesn’t settle anything. I among others continue to use tabs!
One argument for spaces is that a tab could be a different number of columns depending on your environment, but a space is always one column!
One argument for tabs is that they’re a character specifically meant for indentation. They allow developers with different preferences in indentation size to change how the code looks without changing the code!
In conclusion I would say that it doesn’t matter which you use, the important thing is to stick to your choice and be consistent.