What're the real technical key aspects that need to be considered before deciding or coming to a conclusion of battle of Tabs vs Spaces?
For further actions, you may consider blocking this person and/or reporting abuse
What're the real technical key aspects that need to be considered before deciding or coming to a conclusion of battle of Tabs vs Spaces?
For further actions, you may consider blocking this person and/or reporting abuse
Tom Borg -
Ben Halpern -
Jagroop Singh -
Antonio | CEO at Litlyx.com -
Top comments (34)
Its 2020, stop talking about it and start using editorconfig.
Yep. Tabs is the correct answer so people need to stop.
Quick decision!!!
You are absolutely right. The question is though: should we put tabs or spaces in the config? ;-)
Whatever you feel like it. It doesnt matter. And if project already has one, forget about it and do your job.
I was about reply the same :p
Using config is fine.!
I'm collaborating with different projects.
I'm using the tabs in some project and space in some project
Editor config saving me daily. Without mixing up I'm using target things properly.
I use spaces because I stick to conventions, but I would prefer tabs because:
I read a post about a guy with a severe sight issue, who, to be able to code, had a very large font size configured in his IDE.
But at this font size, four spaces are huge, and he had to scroll horizontally all the time.
So each time he edited a file, he changed spaces to tabs (which were displayed with a width of one space), and changed back tabs to spaces before to commit !
For most of us, the battle of tabs vs spaces is totally vain.
For some of us, it can change their everyday experience.
Thank you so much for bringing this reason to my attention.
I will use tabs for all my indentation going forward.
I love tabs
I use spaces, but I've heard a compelling argument favouring tabs.
Tab width can be customized easily in any editor. This is useful for people with visual impairments:
If someone needs larger fonts, then, to fit relevant code in the screen, reducing the tab width might help. With spaces, this kind of customization is hard to accomplish.
This same argument works for 80 character lines.
In the end, I don't really care. I would gladly switch to tabs if that helps people with visual impairments to contribute to open source or private code bases. I only care about consistency.
Use Go so you don't have to decide 😂
The formatting tool uses tabs and that's the standard
I use spaces in all the other languages but I'm super okay with Go which decided to kill this conversation from day 1 😂
GOD MODE
Sorry for the confusion, when I say 4 spaces vs 2 spaces, I mean the tab character
\t
displays as that number of spaces.There is no conversion, the linter keeps everything as tabs so there's to worry of mixing tabs and spaces and everyone can display their indentation how they like.
I think this entire debate isn't really worth discussing given the current state of linting/developer tooling.
IDEs showing tabs how I like is a good thing! If the code base has 2 space indentation, why should I be forced to view my code that way if my IDE can just display it with 4 spaces and commit to GitHub with 2 spaces?
I don't think there's any technical aspect to consider. It boils down to preference mostly. Sure, arguments can be done for both sides, like tabs being awesome because everyone can configure the desired tab length in their code editor, or horrible because they show as eight spaces in GitHub pull-requests. But I have never heard an argument for either side that had any real technical implications.
Thanks
It really dosnt matter, as long as a code base is maintained and standardized.
There is literally nothing worse than seeing a Tabs Vs Spaces comment on a PR, I would hate to know how much time effort and frustration and company times has been lost to this argument.
Added some spaces here
The issue arose from a number of factors, but primarily boils down to the visual differences which occur in badly configured IDEs
I personally use the tab key to indent, but configure my IDE based on the linting rules of the project I am working on.
docs.google.com/presentation/d/1Kk...
Thank you
3 reactions and 21 comments... You knew what you were getting into 😋
Yes....