Programming Tabs vs Spaces
HTML-код
- Опубликовано: 8 фев 2025
- It blows my mind that after all these years we're still having this debate but in this video I lay out exactly why tabs are better than spaces and why we should all stop being so hard headed about it.
Tabs all the way!
It's just simpler and keeps everything aligned.
Software engineer since 1966.
Started with Algol 60, brief time with Fortran.
I started C programming with Whitesmiths, which vertically aligned and indented opening + closing braces. Much easier to understand program structure.
Later moved the braces out to controlling statement indent per newer standards, but still vertically aligned.
Welcome back.
Not really back, this just happened to be a video I felt might not get kicked off :-) I post tons more on rumble and odysee. but thanks.
I'm not sure why it matters how many tabs/spaces you use. Does this affect the way the code runs, or is it just to keep consistent aesthetics?
Only the second part. Generated code is identical.
I just format the file as soon as I open it. Spaces are lame.
Tabs wins every time
I like spaces better it’s more accurate
why does it even matter? Who cares uf the language isnt whitespace based
I would love to hear what you mean about accurate. People have a belief in something because they've always done it that way but never considered something else might make more sense.
@@sacredfroakie1659 As I explained in the video, it does matter when you work on projects with other people. ie: You decided you like 3 spaces and I like 8. Yes, I can set my editor to add in the extra spaces but what I also did is I modified every line of the program to add 5 additional characters times the number of indents and you can no longer find my actual code changes. Tabs on the other hand were created specifically for indention and as a result there is only 1 tab physically there and all I need to do is tell my editor I would like to see a larger gap to represent that tab and neither of us will need to be offended.
Spotted the troll
And that is why you use IDE that handles all spaces/tabs/tabs-to-spaces behind the scene.
As for one symbol vs many - irrelevant in compiled languages.
Also - standards. Who uses 3 spaces? It is 4.
Spaces over tabs.
did you watch the video at all?
@@Justicewarrior795 Yes. Have you?
@@lifebarier Why even go through all the gymnastics needed to handle spaces when you can just use tabs and have all of the problems caused by spaces resolved without having to lobotomize every modern IDE?
@@reoffending Lobotomize IDE? It replaces tabs with as many spaces as I want. Out of the box.