• amanaftermidnight@lemmy.world
    link
    fedilink
    English
    arrow-up
    35
    arrow-down
    17
    ·
    edit-2
    1 year ago

    Most disingenuous post ever.

    The image shown is a dude with a browser dev console, probably measuring a div for the its CSS size (which do support centimeters and inches).

    In python, 4 spaces is just enough spacing between indent levels. And if your levels get too deep it’s a sign that you’re not being pythonic. Nesting too deep is the problem, not the whitespacing being significant.

    • UlrikHD@programming.dev
      link
      fedilink
      arrow-up
      16
      arrow-down
      1
      ·
      1 year ago

      Python are fine with whatever number of spaces you want to use. You can use 8 spaces which forces you carefully consider each nest, you can use 1 if you’re a monster, or you can use tabs if you’re enlightened, python only demands consistency.

      • CoderKat@lemm.ee
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 year ago

        I normally love tabs and it’s what Go uses both by convention and it’s semi opinionated formatter. But PEP-8 suggests spaces and ultimately, consistency is more important.

        Not having to argue about tabs vs spaces lets us focus on the real problems, like vim vs emacs.

        • mexicancartel@lemmy.dbzer0.com
          link
          fedilink
          English
          arrow-up
          1
          ·
          1 year ago

          I am aware but don’t know why four spaces is suggested. Tabs are consistant and flexible. Using spaces might cause errors in number of spaces and makes code messy.

          Also emacs for the win

        • mexicancartel@lemmy.dbzer0.com
          link
          fedilink
          English
          arrow-up
          3
          ·
          1 year ago

          Thats the problem. Then you commit. I clone it. I can’t use tabs because you turned everything into spaces. Why not turn spaces into tabs?