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.

Комментарии • 18

  • @SteamCrane
    @SteamCrane 7 месяцев назад

    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.

  • @mikeryan6277
    @mikeryan6277 3 года назад +2

    Welcome back.

    • @nizexlizzy
      @nizexlizzy  3 года назад

      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.

  • @WhiteOwl12
    @WhiteOwl12 2 года назад +2

    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?

    • @Sparagas
      @Sparagas Год назад

      Only the second part. Generated code is identical.

  • @justingiovanetti
    @justingiovanetti 7 месяцев назад

    I just format the file as soon as I open it. Spaces are lame.

  • @JMACCSArmiesOfMiddleEarth
    @JMACCSArmiesOfMiddleEarth 3 года назад +3

    Tabs wins every time

  • @ethancmorgan
    @ethancmorgan 3 года назад +2

    I like spaces better it’s more accurate

    • @sacredfroakie1659
      @sacredfroakie1659 3 года назад

      why does it even matter? Who cares uf the language isnt whitespace based

    • @nizexlizzy
      @nizexlizzy  3 года назад +2

      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.

    • @nizexlizzy
      @nizexlizzy  3 года назад +5

      @@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.

    • @JMACCSArmiesOfMiddleEarth
      @JMACCSArmiesOfMiddleEarth 3 года назад +2

      Spotted the troll

  • @lifebarier
    @lifebarier 3 года назад

    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.

    • @Justicewarrior795
      @Justicewarrior795 2 года назад +1

      did you watch the video at all?

    • @lifebarier
      @lifebarier 2 года назад +1

      @@Justicewarrior795 Yes. Have you?

    • @reoffending
      @reoffending Год назад +3

      @@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?

    • @lifebarier
      @lifebarier Год назад

      @@reoffending Lobotomize IDE? It replaces tabs with as many spaces as I want. Out of the box.